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_entities
is not the@existinggroup.entities
context and/or the array of added entities is not in that same context, then a BUgSplat! awaits...
You cannot 'cross-thread' entities across contexts...
Advertisement