mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
See #1636. Fix drawing caching when new voids are added or parametric objects updated.
This commit is contained in:
@@ -54,7 +54,7 @@ class TestImportProjectedCRS(NewFile):
|
||||
projected_crs.VerticalDatum = "VerticalDatum"
|
||||
projected_crs.MapProjection = "MapProjection"
|
||||
projected_crs.MapZone = "MapZone"
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", name="METRE")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT")
|
||||
projected_crs.MapUnit = unit
|
||||
subject.import_projected_crs()
|
||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||
@@ -206,7 +206,7 @@ class TestGetCursorLocation(NewFile):
|
||||
tool.Ifc.set(ifc)
|
||||
ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcProject")
|
||||
ifcopenshell.api.run("context.add_context", ifc, context_type="Model")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", prefix="MILLI", name="METRE")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", prefix="MILLI")
|
||||
ifcopenshell.api.run("unit.assign_unit", ifc, units=[unit])
|
||||
bpy.context.scene.cursor.location = (1.0, 2.0, 3.0)
|
||||
assert subject.get_cursor_location() == [1000.0, 2000.0, 3000.0]
|
||||
@@ -218,7 +218,7 @@ class TestSetCursorLocation(NewFile):
|
||||
tool.Ifc.set(ifc)
|
||||
ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcProject")
|
||||
ifcopenshell.api.run("context.add_context", ifc, context_type="Model")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", prefix="MILLI", name="METRE")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", prefix="MILLI")
|
||||
ifcopenshell.api.run("unit.assign_unit", ifc, units=[unit])
|
||||
subject.set_cursor_location([1000.0, 2000.0, 3000.0])
|
||||
assert list(bpy.context.scene.cursor.location) == [1.0, 2.0, 3.0]
|
||||
|
||||
@@ -39,22 +39,3 @@ class TestSetQtoResult(test.bim.bootstrap.NewFile):
|
||||
def test_run(self):
|
||||
subject.set_qto_result(123.4567)
|
||||
assert bpy.context.scene.BIMQtoProperties.qto_result == "123.457"
|
||||
|
||||
class TestGetPsetQtoObjectIfcInfo(test.bim.bootstrap.NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
wall = ifc.createIfcWall()
|
||||
wall_obj = bpy.data.objects.new("Object", bpy.data.meshes.new("Mesh"))
|
||||
tool.Ifc.link(wall, wall_obj)
|
||||
pset_qto = ifcopenshell.api.run("pset.add_qto", ifc, product=wall, name="Qto_foo")
|
||||
assert subject.get_pset_qto_object_ifc_info(wall_obj)['Qto_foo']['id'] == pset_qto.get_info()['id']
|
||||
assert list(subject.get_pset_qto_object_ifc_info(wall_obj).keys())[0] == pset_qto.get_info()['Name']
|
||||
|
||||
def test_isempty(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
wall = ifc.createIfcWall()
|
||||
wall_obj = bpy.data.objects.new("Object", bpy.data.meshes.new("Mesh"))
|
||||
tool.Ifc.link(wall, wall_obj)
|
||||
assert not subject.get_pset_qto_object_ifc_info(wall_obj) == True
|
||||
|
||||
@@ -42,7 +42,7 @@ class TestGetGlobalMatrix(test.bim.bootstrap.NewFile):
|
||||
def test_applying_an_object_placement_blender_offset(self):
|
||||
ifc = ifcopenshell.file()
|
||||
ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcProject")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", name="METRE", prefix="MILLI")
|
||||
unit = ifcopenshell.api.run("unit.add_si_unit", ifc, unit_type="LENGTHUNIT", prefix="MILLI")
|
||||
ifcopenshell.api.run("unit.assign_unit", ifc, units=[unit])
|
||||
tool.Ifc.set(ifc)
|
||||
props = bpy.context.scene.BIMGeoreferenceProperties
|
||||
|
||||
@@ -165,7 +165,7 @@ class TestImportSystems(NewFile):
|
||||
zone = ifc.createIfcZone()
|
||||
subject.import_systems()
|
||||
props = bpy.context.scene.BIMSystemProperties
|
||||
assert len(props.systems) == 1
|
||||
assert len(props.systems) == 2
|
||||
assert props.systems[0].ifc_definition_id == system.id()
|
||||
assert props.systems[0].name == "Unnamed"
|
||||
assert props.systems[0].ifc_class == "IfcDistributionSystem"
|
||||
|
||||
Reference in New Issue
Block a user