Jump to content

contiguous selection


samifox

Recommended Posts

Hi

 

The idea is to simplify a selection of connected lines which are not assembled as 1 polyline.

 

user can select only the starting line , and have all the lines connected to it (or close to be connected to it) joined, and converted into a polyline

 

i was thinking about something like "fillit" command , but i want the selection set to be chosen by a condition

 

see the attached images

any ideas?

 

Thanks

Shay

continue1.jpg

contiguose.jpg

Link to comment
Share on other sites

This is behavior seems to be already built-in in PLINE command; please check the Multiple input option and Join with Fuzzy factor. For sure will need to select more than one item, but would be possible to write a simple AutoLISP routine or a button macro to automate this.

Link to comment
Share on other sites

Shay, maybe this can help you :

 

(defun c:fss (/ ssxunlocked ss i e sss)

 (defun ssxunlocked (/ filter elst ss)
   (setq filter "")
   (while (setq elst (tblnext "layer" (null elst)))
     (if (= 4 (logand 4 (cdr (assoc 70 elst))))
       (setq filter (strcat filter (cdr (assoc 2 elst)) ","))
     )
   )
   (and (= filter "")(setq filter "~*"))
   (setq ss (ssget "_X" (list (cons 0 "*") (cons -4 "<not") (cons 8 filter) (cons -4 "not>"))))
   ss
 )

 (defun fastsel (e / ss i ent)
   (vl-load-com)
   (setq ss (ssxunlocked))
   (setq i -1)
   (if (null sss) (setq sss (ssadd)))
   (while (setq ent (ssname ss (setq i (1+ i))))
     (if (not (eq e ent))
       (if (vlax-invoke (vlax-ename->vla-object e) 'intersectwith (vlax-ename->vla-object ent) acextendnone)
         (ssadd ent sss)
       )
     )
   )
   (ssadd e sss)
 )

 (prompt "\nSelect fast selection object(s) with touching for entities on unlocked layers")
 (setq ss (ssget "_:L"))
 (setq i -1)
 (while (setq e (ssname ss (setq i (1+ i))))
   (fastsel e)
 )
 (sssetfirst nil sss)
 (princ)
)

Link to comment
Share on other sites

ok but how can i loop it all across the lines?

I agree with MSasu tray pedit,Multiple,join and change the fuzz distance as you wish.

 

HTH

mostafa

Link to comment
Share on other sites

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...