mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
bim.load_style - avoid writing to ifc every time
This commit is contained in:
@@ -464,6 +464,7 @@ class LoadStyles(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
style_type = self.style_type if self.style_type else context.scene.BIMStylesProperties.style_type
|
style_type = self.style_type if self.style_type else context.scene.BIMStylesProperties.style_type
|
||||||
core.load_styles(tool.Style, style_type=style_type)
|
core.load_styles(tool.Style, style_type=style_type)
|
||||||
|
bonsai.bim.handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ class Style(bonsai.core.tool.Style):
|
|||||||
for style in styles:
|
for style in styles:
|
||||||
new = props.styles.add()
|
new = props.styles.add()
|
||||||
new.ifc_definition_id = style.id()
|
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()
|
new.ifc_class = style.is_a()
|
||||||
for surface_style in getattr(style, "Styles", []) or []:
|
for surface_style in getattr(style, "Styles", []) or []:
|
||||||
new2 = new.style_classes.add()
|
new2 = new.style_classes.add()
|
||||||
|
|||||||
Reference in New Issue
Block a user