Jump to content

Recommended Posts

Posted

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 

Posted

The number one must be replaced with i variable

(entget (ssname sspl i))

 

What is this for ?

 

(setq tpts (+ tpts pts))

Posted

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

Posted
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)
)

Posted

Thanks I'm on iPad now

I'll test it later

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...