Convert LIST of "Lines" into a "Polyline"

Convert LIST of "Lines" into a "Polyline"

Anonymous
Not applicable
779 Views
1 Reply
Message 1 of 2

Convert LIST of "Lines" into a "Polyline"

Anonymous
Not applicable

I have a list of "LINES" saved, called "lnList".

 

** The list of entities!!!

 

How to make "LINES" in this list into a "POLYLINE" linked with "Join" or "pedit"?

 

 

0 Likes
780 Views
1 Reply
Reply (1)
Message 2 of 2

ВeekeeCZ
Consultant
Consultant

One way, using JOIN and (foreach)

 

(defun c:joinlist ()
  (setq lst (list (car (entsel))
                  (car (entsel))))
  (initcommandversion)
  (command "_.JOIN")
  (foreach e lst (command e))
  (command "")
)

 

Or the second version -- converting lst -> ss first, then simply apply ss for the JOIN function.

(defun c:join2 ( / :lst2ss lst)

  (defun :lst2ss (lst / ss)
    (setq ss (ssadd))
    (foreach e lst (ssadd e ss)))
  
  (setq lst (list (car (entsel))
                  (car (entsel))))
  (initcommandversion)
  (vl-cmdf "_.JOIN" (:lst2ss lst) "")
  )

 

 

0 Likes