Search the Community
Showing results for tags 'points list'.
-
Hello everybuddies, I am new to lisp, so please for your advise. I want to pick an existing multi-segment polyline and use it as a selection fence (ssget "_F") As far as I understand I miss a simple piece of code that lists the points of the polyline in a way that ssget can accept them as a list of points to define the fence. (setq POLY (entsel "\n Pick a Fence Line crossing your beloved entities:")) ****POLY---->(please help!)----->POINTLIST**** (setq ss (ssget "_F" POINTLIST ) ) Thanx in advance
- 13 replies
-
- points list
- fence
-
(and 2 more)
Tagged with:
-
I have a a couple of connected lines in Autocad representing a pipe network. I have a simple lisp routine that parses through all lines and writes in a list all intersections like that (defun nodes (/ s ent i p a b w k) ; creates text labeling on each intersection (setq s (ssget "X" '((0 . "LINE")))) (setq pl nil) (repeat (setq i (sslength s)) (setq ent (entget (ssname s (setq i (1- i))))) (setq p (cdr (assoc 10 ent))) (if (not (member p pl)) (progn (setq k 0) (foreach w pl (if (not (equal w p 0.001)) (setq k (1+ k)) ) ) (if (= k (length pl)) (setq pl (append pl (list p))) ) ) ) (setq p (cdr (assoc 11 ent))) (if (not (member p pl)) (progn (setq k 0) (foreach w pl (if (not (equal w p 0.001)) (setq k (1+ k)) ) ) (if (= k (length pl)) (setq pl (append pl (list p))) ) ) ) ) (princ) ) Using this list I want to number these nodes for the lines connected like that So parsing through each line I have: (setq pt10 (assoc 10 lineprop)) (setq pt11 (assoc 11 lineprop)) (setq node1 (itoa (1+ (vl-position (cdr pt10) pl)))) (setq node2 (itoa (1+ (vl-position (cdr pt11) pl)))) Here comes my problem. For some reason a point (coordinate) in the pl list is not recognized and gives error that it can not find the (cdr ptxx) in the pl list although apparently it is the same. I tried to type manually also !pl returns: ((0.0 0.0 0.09) (5.0 0.0 0.0) ... (3.0 4.0 5.0) ... (7.0 6.0 6.0) (10.0 6.0 6.0)) (member '(3.0 4.0 5.0) pl) returns: nil I understand that the (3.0 4.0 5.0) is not 100% identical with the point in the list. But how can I correct this problem? Any help would be appreciated.