samifox Posted June 21, 2013 Posted June 21, 2013 hi im trying to select several polylines, all their vertices coordinates to a list. for some reason the selection set show correctly the number of members but i cant call them one by one with ssname any idea? Thanks Shay (defun C:DEMO (/ pl pts sspl tpts) (setq sspl (ssget '((0 . "LWPOLYLINE")))) ;_select all polylines and assign them to a selection set sspl (setq i 1) (setq tpts 0) (while (<= i (sslength sspl)) (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (e) (= (Car e) 10) ) (entget(ssname sspl 1)) ) ) ) (setq i (1+ i)) ) (setq tpts (+ tpts pts)) ) ;_run a loop that extract all vertices from all sset members ;_loop vert list ;_create a temp line between 2 points ;_gets its length ;_get its angle ;_if the distance is less than x ;_if the angle is between w and z ;_isolate those verts ;_create a rectangle Quote
Tharwat Posted June 21, 2013 Posted June 21, 2013 The number one must be replaced with i variable (entget (ssname sspl i)) What is this for ? (setq tpts (+ tpts pts)) Quote
samifox Posted June 21, 2013 Author Posted June 21, 2013 It was I instead of 1 but still can't access any member beside 0 member Pts is point list of the poly in loop Tpts is a list that hold pts lists Quote
Tharwat Posted June 21, 2013 Posted June 21, 2013 It was I instead of 1 but still can't access any member beside 0 member Pts is point list of the poly in loop Tpts is a list that hold pts lists This .. ? (defun C:DEMO (/ pl pts sspl tpts i) (if (setq sspl (ssget '((0 . "LWPOLYLINE")))) (progn (setq i 0) (while (< i (sslength sspl)) (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (e) (= (Car e) 10)) (entget (ssname sspl i)) ) ) ) (setq i (1+ i)) (setq tpts (cons pts tpts)) ) ) ) (princ tpts) (princ) ) Quote
samifox Posted June 21, 2013 Author Posted June 21, 2013 Thanks I'm on iPad now I'll test it later Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.