Hi Guys,
I want a lisp that can create points at both the ends for selected lines and whatever the points generated should be in same layer of lines.
Thanks in advance ..
Regards,
T.Brahmanandam
nanaji130285@gmail.com
|
|
|
Hi Guys,
I want a lisp that can create points at both the ends for selected lines and whatever the points generated should be in same layer of lines.
Thanks in advance ..
Regards,
T.Brahmanandam
nanaji130285@gmail.com
Hi,
Something like this ?
Code:(defun c:Test ( / sel ent lst col) ;; Tharwat - Date: 22.Aug.2016 ;; (princ "\nSelect lines to add point objects on both ends:") (if (setq sel (ssget '((0 . "LINE")))) (while (setq ent (ssname sel 0)) (setq lst (entget ent)) (or (setq col (assoc 62 lst)) (setq col (assoc 62 (entget (tblobjname "LAYER" (cdr (assoc 8 lst)))))) ) (mapcar '(lambda (p) (entmake (list '(0 . "POINT") (cons 10 p) col))) (list (cdr (assoc 10 lst)) (cdr (assoc 11 lst)) ) ) (ssdel ent sel) ) ) (princ) )
What about in the case of two lines, on different layers, that share an endpoint?
Do you want two points to be placed there, one of each layer?
R.K. McSwain | CAD Panacea |
Code:(defun c:POL (/ ss i d l) (princ "\nSelect lines to create points on: ") (if (setq ss (ssget '((0 . "LINE")))) (repeat (setq i (sslength ss)) (setq d (entget (ssname ss (setq i (1- i)))) l (assoc 8 d) ) (entmake (list '(0 . "POINT") l (assoc 10 d))) (entmake (list '(0 . "POINT") l (cons 10 (cdr (assoc 11 d))))) ) ) (princ) )
Oops, I went with color in lieu of Layer !
THANK YOU SO MUCH........