Skip to content

Commit fb02ac3

Browse files
committed
Enable selecting group elements
1 parent 81fd842 commit fb02ac3

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/blenderbim/blenderbim/bim/module/group/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
operator.ToggleGroup,
3434
operator.UnassignGroup,
3535
operator.UpdateGroup,
36+
operator.SelectGroupElements,
3637
prop.ExpandedGroups,
3738
prop.Group,
3839
prop.BIMGroupProperties,

src/blenderbim/blenderbim/bim/module/group/operator.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,19 @@ def _execute(self, context):
275275
)
276276
bpy.ops.bim.load_groups()
277277
return {"FINISHED"}
278+
279+
280+
class SelectGroupElements(bpy.types.Operator):
281+
bl_idname = "bim.select_group_elements"
282+
bl_label = "Select Group elements"
283+
bl_options = {"REGISTER", "UNDO"}
284+
group: bpy.props.IntProperty()
285+
286+
@classmethod
287+
def poll(cls, context):
288+
return bool(tool.Ifc.get() and context.active_object)
289+
290+
def execute(self, context):
291+
elements = tool.Drawing.get_group_elements(tool.Ifc.get().by_id(self.group))
292+
tool.Spatial.select_products(elements)
293+
return {"FINISHED"}

src/blenderbim/blenderbim/bim/module/group/ui.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def draw(self, context):
107107
for group in ObjectGroupsData.data["groups"]:
108108
row = self.layout.row(align=True)
109109
row.label(text=group["name"])
110+
row.operator("bim.select_group_elements", text="", icon="RESTRICT_SELECT_OFF").group = group["id"]
110111
op = row.operator("bim.unassign_group", text="", icon="X")
111112
op.group = group["id"]
112113

0 commit comments

Comments
 (0)