bim.load_style - avoid writing to ifc every time

This commit is contained in:
Andrej730
2024-09-30 17:06:43 +05:00
parent e6e6bd841c
commit 616a8882d9
2 changed files with 2 additions and 1 deletions
@@ -464,6 +464,7 @@ class LoadStyles(bpy.types.Operator):
def execute(self, context):
style_type = self.style_type if self.style_type else context.scene.BIMStylesProperties.style_type
core.load_styles(tool.Style, style_type=style_type)
bonsai.bim.handler.refresh_ui_data()
return {"FINISHED"}
+1 -1
View File
@@ -525,7 +525,7 @@ class Style(bonsai.core.tool.Style):
for style in styles:
new = props.styles.add()
new.ifc_definition_id = style.id()
new.name = style.Name or "Unnamed"
new["name"] = style.Name or "Unnamed" # Avoid writing to IFC through callback.
new.ifc_class = style.is_a()
for surface_style in getattr(style, "Styles", []) or []:
new2 = new.style_classes.add()