mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Fixing confusing UI #3357
It was showing "Edit Profile" when you have slab and wall selected when it will actually extend the wall to the slab.
This commit is contained in:
@@ -67,6 +67,7 @@ class AuthoringData:
|
|||||||
cls.data["active_material_usage"] = cls.active_material_usage()
|
cls.data["active_material_usage"] = cls.active_material_usage()
|
||||||
cls.data["active_representation_type"] = cls.active_representation_type()
|
cls.data["active_representation_type"] = cls.active_representation_type()
|
||||||
cls.data["boundary_class"] = cls.boundary_class()
|
cls.data["boundary_class"] = cls.boundary_class()
|
||||||
|
cls.data["selected_material_usages"] = cls.selected_material_usages()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def boundary_class(cls):
|
def boundary_class(cls):
|
||||||
@@ -238,6 +239,23 @@ class AuthoringData:
|
|||||||
return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results]
|
return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def selected_material_usages(cls):
|
||||||
|
selected_usages = {}
|
||||||
|
for obj in bpy.context.selected_objects:
|
||||||
|
element = tool.Ifc.get_entity(obj)
|
||||||
|
if not element:
|
||||||
|
continue
|
||||||
|
usage = tool.Model.get_usage_type(element)
|
||||||
|
if not usage:
|
||||||
|
representation = tool.Geometry.get_active_representation(obj)
|
||||||
|
if representation and representation.RepresentationType == "SweptSolid":
|
||||||
|
usage = "SWEPTSOLID"
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
selected_usages.setdefault(usage, []).append(obj)
|
||||||
|
return selected_usages
|
||||||
|
|
||||||
|
|
||||||
class ArrayData:
|
class ArrayData:
|
||||||
data = {}
|
data = {}
|
||||||
|
|||||||
@@ -176,7 +176,11 @@ class BimToolUI:
|
|||||||
row.operator("bim.join_wall", icon="X", text="").join_type = ""
|
row.operator("bim.join_wall", icon="X", text="").join_type = ""
|
||||||
|
|
||||||
elif AuthoringData.data["active_material_usage"] == "LAYER3":
|
elif AuthoringData.data["active_material_usage"] == "LAYER3":
|
||||||
add_layout_hotkey_operator(cls.layout, "Edit Profile", "S_E", "")
|
|
||||||
|
if len(context.selected_objects) == 1:
|
||||||
|
add_layout_hotkey_operator(cls.layout, "Edit Profile", "S_E", "")
|
||||||
|
elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
|
||||||
|
add_layout_hotkey_operator(cls.layout, "Extend Wall To Slab", "S_E", "")
|
||||||
|
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
row.prop(data=cls.props, property="x_angle", text="X Angle")
|
||||||
|
|||||||
Reference in New Issue
Block a user