Lisp for line drawing
Hi all,
I was wondering if anyone one knows of a Lisp that would allow me to draw a new line or polyline that automatically draws it in the layer at which the lines start point layer is?
I.E
The current layer is:0
I want to draw line from a point or end of line that is in layer building I want the layer of new line automatically to be drawn in building.. and so on..
Fingers crossed there is such a thing! Thanks
Comments
-
The built-in ADDSELECTED is close, but you do need to select the entity first.
0 -
Hi David,
Thanks for this. I havent used this command before.Youre right, it is close.. but no cigar.
I like that the command also adopts the points drawing comand I.E. line, arc, polyline..
0 -
You posted elsewhere also. This was suggestion, add your other post as a link.
(defun c:testline ( / oldsnap pt ss)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 1)
(setq pt (getpoint "\nPick start point "))
(setq ss (ssget pt))
(setq entlay (cdr (assoc 8 (entget (ssname ss 0)))))
(setvar 'clayer entlay)
(command-s "line" pt )
(setvar 'osmode oldsnap)
(princ)
)0