I am working with multiple models on the same file composed of many individual parts.
I was wondering if there was a way to automatically generate an individual bounding box for each selected group. And by this I mean the higher level group, as sometimes there can be a group within a group.
import rhinoscriptsyntax as rs
import Rhino
groupTable = Rhino.RhinoDoc.ActiveDoc.Groups.GroupNames(True)
selectedGroupNames = Rhino.UI.Dialogs.ShowMultiListBox("Select as many group as you like", "Select Group", groupTable, None)
for name in selectedGroupNames:
index = Rhino.RhinoDoc.ActiveDoc.Groups.Find(name)
objects = Rhino.RhinoDoc.ActiveDoc.Groups.GroupMembers(index)
ids = []
for obj in objects:
ids.append(obj.Id)
rs.AddBox(rs.BoundingBox(ids))