bim.edit_style to update representations if Side was edited

Mentioned in #5604. Since IfcSurfaceStyle.Side is used during representation generation, we need to regenerate them if the value was changed. Previously it would require manual update / project reload.
This commit is contained in:
Andrej730
2024-10-21 14:40:24 +05:00
parent ce6c56cab4
commit 45b3008b99
4 changed files with 39 additions and 1 deletions
+19 -1
View File
@@ -195,10 +195,28 @@ class TestDisableEditingStyle:
class TestEditStyle:
def test_run(self, ifc, style):
def test_run_side_attr_updated(self, ifc, style):
style.get_currently_edited_material().should_be_called().will_return("obj")
style.get_style("obj").should_be_called().will_return("style_element")
style.export_surface_attributes().should_be_called().will_return("attributes")
style.is_style_side_attribute_edited("style_element", "attributes").should_be_called().will_return(True)
ifc.run("style.edit_presentation_style", style="style_element", attributes="attributes").should_be_called()
style.disable_editing().should_be_called()
style.get_active_style_type().should_be_called().will_return("style_type")
# Calling core.load_styles.
style.import_presentation_styles("style_type").should_be_called()
style.enable_editing_styles().should_be_called()
style.reload_repersentations("style_element").should_be_called()
subject.edit_style(ifc, style)
def test_run_side_attr_unchanged(self, ifc, style):
style.get_currently_edited_material().should_be_called().will_return("obj")
style.get_style("obj").should_be_called().will_return("style_element")
style.export_surface_attributes().should_be_called().will_return("attributes")
style.is_style_side_attribute_edited("style_element", "attributes").should_be_called().will_return(False)
ifc.run("style.edit_presentation_style", style="style_element", attributes="attributes").should_be_called()
style.disable_editing().should_be_called()
style.get_active_style_type().should_be_called().will_return("style_type")