option to set active system

Now it's possible to set in UI active system (currently it's done "select" button next to the system).

Also changed the elements that are going to be decorated with system decorator. Previously it was decorating all the mep elements in the projects which was very performance heavy on large projects.
This commit is contained in:
Andrej730
2023-10-20 14:02:26 +05:00
parent 424042474b
commit fb650a8516
9 changed files with 85 additions and 39 deletions
+2 -1
View File
@@ -62,7 +62,7 @@ class TestRemoveSystem:
class TestEnableEditingSystem:
def test_run(self, system):
system.import_system_attributes("system").should_be_called()
system.set_active_system("system").should_be_called()
system.set_active_edited_system("system").should_be_called()
subject.enable_editing_system(system, system="system")
@@ -87,6 +87,7 @@ class TestUnassignSystem:
class TestSelectSystemProducts:
def test_run(self, system):
system.select_system_products("system").should_be_called()
system.set_active_system("system").should_be_called()
subject.select_system_products(system, system="system")
+4 -4
View File
@@ -53,9 +53,9 @@ class TestDeleteElementObjects(NewFile):
class TestDisableEditingSystem(NewFile):
def test_run(self):
bpy.context.scene.BIMSystemProperties.active_system_id = 10
bpy.context.scene.BIMSystemProperties.edited_system_id = 10
subject.disable_editing_system()
assert bpy.context.scene.BIMSystemProperties.active_system_id == 0
assert bpy.context.scene.BIMSystemProperties.edited_system_id == 0
class TestDisableSystemEditingUI(NewFile):
@@ -219,5 +219,5 @@ class TestSetActiveSystem(NewFile):
ifc = ifcopenshell.file()
tool.Ifc().set(ifc)
system = ifcopenshell.api.run("system.add_system", ifc, ifc_class="IfcSystem")
subject.set_active_system(system)
assert bpy.context.scene.BIMSystemProperties.active_system_id == system.id()
subject.set_active_edited_system(system)
assert bpy.context.scene.BIMSystemProperties.edited_system_id == system.id()