mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Keep bim.select_container available for IfcProjects too
As it's the quicker way to select it than searching it in outliner - https://i.imgur.com/p2NVcdR.png Couldn't find a simpler a way to do it in UI and had to create bunch of columns. Tried to use splits but they end up readjusting the buttons.
This commit is contained in:
@@ -136,21 +136,38 @@ class BIM_PT_spatial_decomposition(Panel):
|
||||
op.part_class = self.props.subelement_class
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
if self.props.active_container.ifc_class == "IfcProject":
|
||||
row.enabled = False
|
||||
op = row.operator("bim.set_default_container", icon="OUTLINER_COLLECTION", text="Set Default")
|
||||
non_ifc_project_active = self.props.active_container.ifc_class != "IfcProject"
|
||||
|
||||
col = row.column(align=True)
|
||||
col.enabled = non_ifc_project_active
|
||||
op = col.operator("bim.set_default_container", icon="OUTLINER_COLLECTION", text="Set Default")
|
||||
op.container = ifc_definition_id
|
||||
op = row.operator("bim.set_container_visibility", icon="FULLSCREEN_EXIT", text="Isolate")
|
||||
|
||||
col = row.column(align=True)
|
||||
col.enabled = non_ifc_project_active
|
||||
op = col.operator("bim.set_container_visibility", icon="FULLSCREEN_EXIT", text="Isolate")
|
||||
op.mode = "ISOLATE"
|
||||
op.container = ifc_definition_id
|
||||
op = row.operator("bim.set_container_visibility", icon="HIDE_OFF", text="")
|
||||
|
||||
col = row.column(align=True)
|
||||
col.enabled = non_ifc_project_active
|
||||
op = col.operator("bim.set_container_visibility", icon="HIDE_OFF", text="")
|
||||
op.mode = "SHOW"
|
||||
op.container = ifc_definition_id
|
||||
op = row.operator("bim.set_container_visibility", icon="HIDE_ON", text="")
|
||||
|
||||
col = row.column(align=True)
|
||||
col.enabled = non_ifc_project_active
|
||||
op = col.operator("bim.set_container_visibility", icon="HIDE_ON", text="")
|
||||
op.mode = "HIDE"
|
||||
op.container = ifc_definition_id
|
||||
row.operator("bim.select_container", icon="OBJECT_DATA", text="").container = ifc_definition_id
|
||||
op = row.operator("bim.delete_container", icon="X", text="")
|
||||
|
||||
# The only operator that's enabled for IfcProject.
|
||||
col = row.column(align=True)
|
||||
col.operator("bim.select_container", icon="OBJECT_DATA", text="").container = ifc_definition_id
|
||||
|
||||
col = row.column(align=True)
|
||||
col.enabled = non_ifc_project_active
|
||||
op = col.operator("bim.delete_container", icon="X", text="")
|
||||
op.container = ifc_definition_id
|
||||
|
||||
self.layout.template_list(
|
||||
|
||||
Reference in New Issue
Block a user