mhupp Posted October 10, 2021 Posted October 10, 2021 Is there a better way to do this? only want to make one manual selection for two or more Selection sets. Currently I am using the following. (if (setq SS (ssget)) ;Basic ssget to select everything (progn (if (setq SS1 (ssget "_P" '((0 . "LWPOLYLINE,CIRCLE") (8 . "layer") (410 . "Model")))) ;first selection *do stuff ) (vl-cmdf "_.Select" SS "") ;is their a visual lisp of this command (if (setq SS1 (ssget "_P" '((0 . "LWPOLYLINE,CIRCLE") (8 . "diffrent layers") (410 . "Model")))) ;second selecion *do other stuff ) ) (prompt "\nNothing Selected") ) Quote
confutatis Posted October 10, 2021 Posted October 10, 2021 (edited) (if (setq SS (ssget)) ;Basic ssget to select everything (if (setq SS1 (ssget "_P" '((0 . "LWPOLYLINE,CIRCLE") (8 . "layer") (410 . "Model")))) ;first selection *do stuff (if (setq SS1 (ssget "_P" '((0 . "LWPOLYLINE,CIRCLE") (8 . "diffrent layer") (410 . "Model")))) ;second selecion *do other stuff ) ) (prompt "\nNothing Selected") ) Edited October 10, 2021 by confutatis Quote
Lee Mac Posted October 10, 2021 Posted October 10, 2021 (edited) I would suggest the following approach - acquire a selection set representing the union of the two sets and then use a conditional statement when iterating over the set: (if (setq s (ssget '((0 . "LWPOLYLINE,CIRCLE") (8 . "Layer,Different Layers") (410 . "Model")))) (repeat (setq i (sslength s)) (setq i (1- i) e (ssname s i) ) (if (wcmatch (cdr (assoc 8 (entget e))) "Layer") (progn ;; Do something ) (progn ;; Else do something ) ) ) ) Edited October 10, 2021 by Lee Mac 2 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.