mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
Enable selecting group elements
This commit is contained in:
@@ -33,6 +33,7 @@ classes = (
|
|||||||
operator.ToggleGroup,
|
operator.ToggleGroup,
|
||||||
operator.UnassignGroup,
|
operator.UnassignGroup,
|
||||||
operator.UpdateGroup,
|
operator.UpdateGroup,
|
||||||
|
operator.SelectGroupElements,
|
||||||
prop.ExpandedGroups,
|
prop.ExpandedGroups,
|
||||||
prop.Group,
|
prop.Group,
|
||||||
prop.BIMGroupProperties,
|
prop.BIMGroupProperties,
|
||||||
|
|||||||
@@ -275,3 +275,19 @@ class UpdateGroup(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
)
|
)
|
||||||
bpy.ops.bim.load_groups()
|
bpy.ops.bim.load_groups()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class SelectGroupElements(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.select_group_elements"
|
||||||
|
bl_label = "Select Group elements"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
group: bpy.props.IntProperty()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return bool(tool.Ifc.get() and context.active_object)
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
elements = tool.Drawing.get_group_elements(tool.Ifc.get().by_id(self.group))
|
||||||
|
tool.Spatial.select_products(elements)
|
||||||
|
return {"FINISHED"}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ class BIM_PT_object_groups(Panel):
|
|||||||
for group in ObjectGroupsData.data["groups"]:
|
for group in ObjectGroupsData.data["groups"]:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text=group["name"])
|
row.label(text=group["name"])
|
||||||
|
row.operator("bim.select_group_elements", text="", icon="RESTRICT_SELECT_OFF").group = group["id"]
|
||||||
op = row.operator("bim.unassign_group", text="", icon="X")
|
op = row.operator("bim.unassign_group", text="", icon="X")
|
||||||
op.group = group["id"]
|
op.group = group["id"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user