Sync ifc class in BIM Tool and Type Manager

It's seems it would be better for ux if they will be connected
This commit is contained in:
Andrej730
2023-07-04 17:17:32 +05:00
parent 52a8fcd86e
commit 66c275f617
2 changed files with 6 additions and 0 deletions
@@ -69,6 +69,10 @@ def update_type_class(self, context):
AuthoringData.data["paginated_relating_types"] = AuthoringData.paginated_relating_types()
AuthoringData.data["type_predefined_type"] = AuthoringData.type_predefined_type()
type_class = self.type_class
if (type_class, type_class, "") in get_ifc_class(self, context):
self.ifc_class = type_class
def update_relating_type_id(self, context):
AuthoringData.data["relating_type_id"] = AuthoringData.relating_type_id()
@@ -205,6 +205,7 @@ class AddType(bpy.types.Operator, tool.Ifc.Operator):
ifc_file = tool.Ifc.get()
body = ifcopenshell.util.representation.get_context(ifc_file, "Model", "Body", "MODEL_VIEW")
if not body:
props.type_class = props.type_class
return {"FINISHED"}
if template == "MESH":
@@ -415,6 +416,7 @@ class AddType(bpy.types.Operator, tool.Ifc.Operator):
bpy.ops.bim.add_roof()
bpy.ops.bim.load_type_thumbnails(ifc_class=ifc_class)
props.type_class = props.type_class
return {"FINISHED"}
def add_default_material(self):