Here is a rework of my Wall Offset Routine.
You enter o16 to round off to 1/16.
Enter o8 to use 1/8. You can add more.
Pick an object that needs to be moved.
Then pick the line that is stationary and to be measured from.
The routine presents you with a prompt of the existing measurement, and a rounded measurement.
Press "+" [enter] to increment the measurement by the round amount (1/16) in this case.
Or press "-" [enter] to reduce the measurement by the round amount.
Press enter to except the new measurement.
The new target line is created on layer "0" at the new measurement.
You are then asked to select via window the objects to be stretched.
The objects are stretched & the new line is erased.
The routine has limitations:
Will not work on rectangles as the picked objects.
Objects must be aligned with the XY axis.
Remember this is just a quick fix solution.
;; 02/07/2008 CAB
;; offset lines by picking the distance & line to offset
;; routine calcs fractional distance, confirms distance
;; then offsets the line to layer, allows you to pick window
;; to be streched. Then erases the line
;;
;; The routine has limitations:
;; Will not work on rectangles as the picked objects.
;; Objects must be aligned with the XY axis.
(defun OffsetRnd (rndto / DIST OFS P1 p2 p3 p4 USERCMD USEROS ent rndto *error*)
(vl-load-com)
(defun *error*( err)
(and useros (setvar "osmode" useros) (setq useros nil))
(and ent (entdel ent) (setq ent nil))
(princ err)
(princ)
)
(command "undo" "begin")
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq useros (getvar "osmode"))
(setvar "osmode" 512) ; near
(setq rndto (/ 1.0 rndto))
(setq p1 (getpoint "\nPick a point near the miss aligned object."))
(setq ent (entsel "\nSelect Line to offset.")
obj (vlax-ename->vla-object (car ent))
p2 (vlax-curve-getclosestpointto obj p1 t);perp point
dist (distance p1 p2)
d (*(fix(+(/ dist rndto) 0.5)) rndto)
)
(while
(cond
((= (setq ofs (getstring t (strcat "\nEnter the offset distance.[+ -] Now= "
(rtos dist 4 6) " <"(rtos d)"> "))) "")
(setq ofs d)
nil
)
((= ofs "+") (setq d (+ d rndto)))
((= ofs "-") (setq d (- d rndto)))
((null (setq ofs (distof ofs))) (princ "\nInvalid input, Try again."))
((numberp ofs) nil)
(t (princ "\nInvalid input, Try again."))
)
)
(setvar "osmode" 0)
(command ".offset" ofs (car ent) "none" p1 "")
(setq ent (entlast))
(command ".change" ent "" "P" "LA" "0" "")
(if (and (setq p3 (getpoint "\nSelect objects to stretch by crossing-window"))
(setq p4 (getcorner p3 "\nSpecify opposite corner:"))
)
(command ".stretch" "CP" p3 (list (car p3)(cadr p4))
p4 (list (car p4)(cadr p3)) "" "" p1 (polar p1 (angle p2 p1) (- ofs dist)))
)
(entdel ent)
(setvar "CMDECHO" usercmd)
(setvar "osmode" useros)
(command "undo" "end")
(princ)
)
(defun c:o16 () ; Offset to 1/16"
(OffsetRnd 16)
(princ)
)
(defun c:o8 () ; Offset to 1/8"
(OffsetRnd 8)
(princ)
)