This LISP makes n copies of an object and distribute it evenly between two points. It woks fine, but if I zoom out after picking points, the objects just ends up in a lump. (AutoCAD 2011)
Does zooming affect the values of p1 and pt? How can i fix this? I Use the copy command with basepoint p1 and new point pt.
Code:
(defun c:c2 (/ ss p1 p2 n l pt)
(if
(and
(setq ss (ssget))
(setq p1 (getpoint "\nSpecify first point:"))
(setq p2 (getpoint p1 "\nSpecify Second point:"))
(setq n (getint "\nSpecify number of objects between points:"))
)
(progn
(setq pt p1)
(setq l (/ (distance p1 p2) (+ n 1)))
(repeat n
(setq pt (polar pt (angle p1 p2) l))
(command "COPY" ss "" p1 pt)
)
)
(princ)
)
(princ)
)