mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Enable adding fillings from the opening object ui
This commit is contained in:
@@ -38,9 +38,28 @@ class BIM_PT_voids(Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
props = context.active_object.BIMObjectProperties
|
props = context.active_object.BIMObjectProperties
|
||||||
|
file = IfcStore.get_file()
|
||||||
if props.ifc_definition_id not in Data.products:
|
if props.ifc_definition_id not in Data.products:
|
||||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
Data.load(file, props.ifc_definition_id)
|
||||||
|
|
||||||
|
element = file.by_id(props.ifc_definition_id)
|
||||||
|
if element.is_a("IfcOpeningElement"):
|
||||||
|
self.layout.label(text="Select a filling")
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
row.prop(context.scene.VoidProperties, "desired_opening", text="", icon="SELECT_INTERSECT")
|
||||||
|
op = row.operator("bim.add_filling", icon="ADD", text="")
|
||||||
|
if context.scene.VoidProperties.desired_opening:
|
||||||
|
op.opening = context.active_object.name
|
||||||
|
op.obj = context.scene.VoidProperties.desired_opening.name
|
||||||
|
if props.ifc_definition_id in Data.openings and Data.openings[props.ifc_definition_id]["HasFillings"]:
|
||||||
|
for filling_id in Data.openings[props.ifc_definition_id]["HasFillings"]:
|
||||||
|
if filling_id not in Data.fillings:
|
||||||
|
continue
|
||||||
|
row = self.layout.row(align=True)
|
||||||
|
row.label(text=Data.fillings[filling_id]["Name"], icon="SELECT_INTERSECT")
|
||||||
|
op = row.operator("bim.remove_filling", icon="X", text="")
|
||||||
|
op.obj = IfcStore.id_map[filling_id].name
|
||||||
|
else:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
if len(context.selected_objects) == 2:
|
if len(context.selected_objects) == 2:
|
||||||
op = row.operator("bim.add_opening", icon="ADD", text="Add Opening")
|
op = row.operator("bim.add_opening", icon="ADD", text="Add Opening")
|
||||||
|
|||||||
Reference in New Issue
Block a user