Add an array of entities to an existing group?
-
Normally I add a group of entities (groups and components in an array) to my large assembly group with this single line of code:
@maingroup = Sketchup.active_model.entities.add_group(@all_trusses)
Instead I would like to add my array of entitities “@all_trusses” to an existing group that has already been created and is essentially empty except for a small place holder entity in it to prevent it from being garbage collected.
-
@medeek said:
Normally I add a group of entities (groups and components in an array) to my large assembly group with this single line of code:
@maingroup = Sketchup.active_model.entities.add_group(@all_trusses)
Instead I would like to add my array of entitities “@all_trusses” to an existing group that has already been created and is essentially empty except for a small place holder entity in it to prevent it from being garbage collected.
How about
@existinggroup.entities.add_group(@all_trusses) -
Unfortunately, if the
model.active_entitiesis not the@existinggroup.entitiescontext and/or the array of added entities is not in that same context, then a BUgSplat! awaits...
You cannot 'cross-thread' entities across contexts...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement