Grouping loose geometry inside an existing group

I have a container group that includes several sub-groups. Inside one of these sub groups I have some connected loose geometry that I would like to group as well using a plugin. Is this possible or will parenting issues prevent it.

something like this should work…

if sub_grp.grep(Sketchup::Group) > 0 && sub_grp.grep(Sketchup::Edge) > 0 
  sub_grp.entities.add_group( sub_grp.grep(Sketchup::Edge){|e| e.all_connected}.flatten )



It works, sort of, but like my test, the new group created is on the model level instead of inside the sub group.

Both of these expressions are comparing an array against an integer;
I think there’s a .size call missing for each.

And the model entities are the active_entities ?
I think this is normal. Prevents BugSplats.

You may need to subsequently, do …

nested_grp = sub_grp.add_instance(IDENTITY,new_grp.definition)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.