Jump to content

Recommended Posts

Posted

Can somebody elaborate a bit about this -4 code and filters with wildcards in a selection set and explain how it really works? I am using the following:

 

(setq pt '(0 0 2.5))
(setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,*") (cons 10 pt))))

 

My intent is to pick a line that passes through point 'pt' and make a selection set with this one only regardless how many other are crossing behind this line (visually passing through the pt).

 

If I use the following it gives me always nil eventhough my line passes through this point (pt).

 

(setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,=") (cons 10 pt))))

 

Why is that?

Posted

DXF group 10 is the line start point, therefore, your ssget filter list is currently only permitting lines whose start point is at (0,0) and which pass through the point (0,0,2.5).

Posted

Thanks. It is a bit clearer now. At the end, would it be possible to select just this line somehow by clicking an arbitrary point (not start or end) withough selecting other lines behind but visually passing through pt?

Posted

I finaly managed to do it this way (at least I think)

 

(setq ept (osnap ppt "_endp"))
(if (not (setq st (ssget "C" ppt ppt (list (cons 0 "LINE") (cons -4 "=,*,*") (cons 10 (list (car ept) 0.0 0.0))))))

(setq st (ssget "C" ppt ppt (list (cons 0 "LINE") (cons -4 "=,*,*") (cons 11 (list (car ept) 0.0 0.0)))))
)

 

where ppt is any point belongin to the line.

Posted

If you have ppt - any point belonging to a line and you want to select that line, wouldn't this be enough :

 

(setq ss (ssget "_C" ppt ppt '((0 . "LINE"))))
(setq s (ssadd))
(repeat (setq i (sslength ss))
 (setq line (ssname ss (setq i (1- i))))
 (if (vlax-curve-getparamatpoint line ppt)
   (ssadd line s)
 )
)
(sssetfirst nil s)

Posted (edited)

True, and it seems your way works for any entity.

 

EDIT: Actually it does not. Anyone knows an other command instead of vlax-curve-getparamatpoint, that can pick blocks?

Edited by MJLM

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