This commit is contained in:
Andrej730
2025-02-24 11:37:19 +05:00
parent 0783f8082e
commit 6eda4e389c
34 changed files with 336 additions and 245 deletions
+3 -2
View File
@@ -383,7 +383,8 @@ class TestUsingArrays(NewFile):
bpy.ops.mesh.primitive_cube_add()
obj = bpy.context.active_object
bpy.context.scene.BIMRootProperties.ifc_product = "IfcElement"
rprops = tool.Root.get_root_props()
rprops.ifc_product = "IfcElement"
bpy.ops.bim.assign_class(ifc_class="IfcActuator", predefined_type="ELECTRICACTUATOR", userdefined_type="")
bpy.ops.bim.add_array()
@@ -520,7 +521,7 @@ class TestApplyIfcMaterialChanges(NewFile):
bpy.ops.bim.add_constr_type_instance(relating_type_id=relating_type_id)
with_opening = bpy.context.active_object
with_opening.name = "With Opening"
props = bpy.context.scene.BIMRootProperties
props = tool.Root.get_root_props()
props.representation_obj = with_opening
bpy.ops.bim.add_element(ifc_product="IfcFeatureElement", ifc_class="IfcOpeningElement")
+4 -2
View File
@@ -97,7 +97,8 @@ class TestSetContext(NewFile):
tool.Ifc.set(ifc)
context = ifc.createIfcGeometricRepresentationContext()
subject.set_context(context)
assert bpy.context.scene.BIMRootProperties.contexts == str(context.id())
rprops = tool.Root.get_root_props()
assert rprops.contexts == str(context.id())
class TestSetDefaultContext(NewFile):
@@ -115,7 +116,8 @@ class TestSetDefaultContext(NewFile):
target_view="MODEL_VIEW",
)
subject.set_default_context()
assert bpy.context.scene.BIMRootProperties.contexts == str(body.id())
rprops = tool.Root.get_root_props()
assert rprops.contexts == str(body.id())
class TestSetDefaultModelingDimensions(NewFile):
+4 -2
View File
@@ -191,8 +191,10 @@ class TestReassignClass(NewFile):
slabs = [tool.Ifc.get_object(e) for e in ifc_file.by_type("IfcSlab")]
assert len(slabs) == 3
tool.Blender.set_objects_selection(context, slabs[0], (slabs[1],))
context.scene.BIMRootProperties.ifc_product = "IfcElement"
context.scene.BIMRootProperties.ifc_class = "IfcWall"
props = tool.Root.get_root_props()
props.ifc_product = "IfcElement"
props.ifc_class = "IfcWall"
bpy.ops.bim.reassign_class()
assert len(ifc_file.by_type("IfcWall")) == 3
+4 -2
View File
@@ -129,7 +129,8 @@ class TestDisableEditing(NewFile):
obj = bpy.data.objects.new("Object", None)
subject.enable_editing(obj)
subject.disable_editing(obj)
assert obj.BIMObjectSpatialProperties.is_editing is False
props = tool.Spatial.get_object_spatial_props(obj)
assert props.is_editing is False
class TestDuplicateObjectAndData(NewFile):
@@ -148,7 +149,8 @@ class TestEnableEditing(NewFile):
def test_run(self):
obj = bpy.data.objects.new("Object", None)
subject.enable_editing(obj)
assert obj.BIMObjectSpatialProperties.is_editing is True
props = tool.Spatial.get_object_spatial_props(obj)
assert props.is_editing is True
class TestGetContainer(NewFile):