Aditya Bagaskara Posted February 12, 2023 Posted February 12, 2023 How do I group list of objects after it is created through AutoLISP? When I type (command "group") into the VLIDE and run it, it shows me these choices, and these choices didn't give me a chance to select things. Same thing happened when I have a list of entities in a variable. I can't use (command "group") to group them. What is the solution? Quote
mhupp Posted February 12, 2023 Posted February 12, 2023 This is the most compact metod I have found to add modified or created entites to a new or existing selection set. (setq LastEnt (entlast)) ;set right before you create objects. (setq SS (ssadd)) ;is needed if selection set is new (while (setq LastEnt (entnext LastEnt)) ;after entities are created this will add them to a selection set. (ssadd EntLst SS) ) Nice thing is now is you now have another save point. an can use the while again to add more entites to the same selection set or a diffrent one. adding above code to your first lisp. then right before the exit run (sssetfirst nil ss) will select all the entities in SS. Then you can use (ssget "_I") or group Quote
Aditya Bagaskara Posted February 13, 2023 Author Posted February 13, 2023 9 hours ago, mhupp said: This is the most compact metod I have found to add modified or created entites to a new or existing selection set. (setq LastEnt (entlast)) ;set right before you create objects. (setq SS (ssadd)) ;is needed if selection set is new (while (setq LastEnt (entnext LastEnt)) ;after entities are created this will add them to a selection set. (ssadd EntLst SS) ) Nice thing is now is you now have another save point. an can use the while again to add more entites to the same selection set or a diffrent one. adding above code to your first lisp. then right before the exit run (sssetfirst nil ss) will select all the entities in SS. Then you can use (ssget "_I") or group So I have to put a list of objects into a selection set so i can group them? Quote
mhupp Posted February 13, 2023 Posted February 13, 2023 Never really used group. but according to this post. (command "_.group" "c" (randomHEX) "group_desc" ss "") in lisp The group command is looking for "C" for create Group name Group Desc THEN what you want in the group. (Could use the selection set or manually select what you want with a pause) "" to end the command Quote
Aditya Bagaskara Posted February 13, 2023 Author Posted February 13, 2023 11 hours ago, mhupp said: Never really used group. but according to this post. (command "_.group" "c" (randomHEX) "group_desc" ss "") in lisp The group command is looking for "C" for create Group name Group Desc THEN what you want in the group. (Could use the selection set or manually select what you want with a pause) "" to end the command What does the (randomHEX) do, sir? 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.