Now generate space and generate spaces from walls are always visible in the UI so users understand better that are different procedures

This commit is contained in:
Massimo Fabbro
2024-02-18 16:12:34 +01:00
committed by Massimo Fabbro
parent c1cd228911
commit 066616707a
2 changed files with 8 additions and 5 deletions
@@ -35,7 +35,9 @@ class GenerateSpace(bpy.types.Operator, tool.Ifc.Operator):
def poll(cls, context):
collection = context.view_layer.active_layer_collection.collection
collection_obj = collection.BIMCollectionProperties.obj
return tool.Ifc.get_entity(collection_obj)
active_obj = bpy.context.active_object
element = tool.Ifc.get_entity(active_obj)
return tool.Ifc.get_entity(collection_obj) and not element.is_a("IfcWall")
def _execute(self, context):
# This works as a 2.5 extruded polygon based on a cutting plane. Note
@@ -98,10 +98,11 @@ class SpatialToolUI:
row = cls.layout.row(align=True)
row.label(text="", icon="EVENT_SHIFT")
row.label(text="", icon="EVENT_A")
if context.selected_objects:
row.operator("bim.generate_spaces_from_walls")
else:
row.operator("bim.generate_space")
row.operator("bim.generate_spaces_from_walls")
row = cls.layout.row(align=True)
row.label(text="", icon="EVENT_SHIFT")
row.label(text="", icon="EVENT_A")
row.operator("bim.generate_space")
row = cls.layout.row(align=True)
row.label(text="", icon="EVENT_SHIFT")
row.label(text="", icon="EVENT_T")