MJLM Posted June 14, 2016 Posted June 14, 2016 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? Quote
Lee Mac Posted June 14, 2016 Posted June 14, 2016 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). Quote
MJLM Posted June 14, 2016 Author Posted June 14, 2016 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? Quote
MJLM Posted June 15, 2016 Author Posted June 15, 2016 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. Quote
marko_ribar Posted June 15, 2016 Posted June 15, 2016 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) Quote
MJLM Posted June 17, 2016 Author Posted June 17, 2016 (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 June 17, 2016 by MJLM 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.