Jump to content

Grouping two or more objects after being created


Recommended Posts

Posted

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?

Posted

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

 

 

Posted
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?

Posted

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

 

Posted
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?

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