mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 00:46:36 +00:00
typing
This commit is contained in:
@@ -192,12 +192,12 @@ def the_object_name_does_not_exist(name):
|
||||
|
||||
def the_object_name_is_an_ifc_class(name, ifc_class):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert element.is_a(ifc_class), f'Object "{name}" is an {element.is_a()}'
|
||||
|
||||
|
||||
def the_object_name_is_not_an_ifc_element(name):
|
||||
id = the_object_name_exists(name).BIMObjectProperties.ifc_definition_id
|
||||
id = tool.Blender.get_ifc_definition_id(the_object_name_exists(name))
|
||||
assert id == 0, f"The ID is {id}"
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ def the_object_name_is_placed_in_the_collection_collection(name, collection):
|
||||
|
||||
def the_object_name_has_a_type_representation_of_context(name, type, context):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
context, subcontext, target_view = context.split("/")
|
||||
assert ifcopenshell.util.representation.get_representation(
|
||||
element, context, subcontext or None, target_view or None
|
||||
@@ -238,7 +238,7 @@ def the_object_name_has_a_type_representation_of_context(name, type, context):
|
||||
|
||||
def the_object_name_is_contained_in_container_name(name, container_name):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
container = ifcopenshell.util.element.get_container(element)
|
||||
if not container:
|
||||
assert False, f'Object "{name}" is not in any container'
|
||||
@@ -257,8 +257,8 @@ def i_delete_the_selected_objects():
|
||||
|
||||
def the_object_name1_and_name2_are_different_elements(name1, name2):
|
||||
ifc = an_ifc_file_exists()
|
||||
element1 = ifc.by_id(the_object_name_exists(name1).BIMObjectProperties.ifc_definition_id)
|
||||
element2 = ifc.by_id(the_object_name_exists(name2).BIMObjectProperties.ifc_definition_id)
|
||||
element1 = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name1)))
|
||||
element2 = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name2)))
|
||||
assert element1 != element2, f"Objects {name1} and {name2} have same elements {element1} and {element2}"
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ def the_object_name1_has_no_boolean_difference_by_name2(name1, name2):
|
||||
|
||||
def the_object_name_is_voided_by_void(name, void):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
for rel in element.HasOpenings:
|
||||
if rel.RelatedOpeningElement.Name == void:
|
||||
return True
|
||||
@@ -293,7 +293,7 @@ def the_object_name_is_voided_by_void(name, void):
|
||||
|
||||
def the_object_name_is_not_voided_by_void(name, void):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
for rel in element.HasOpenings:
|
||||
if rel.RelatedOpeningElement.Name == void:
|
||||
assert False, "A void was found"
|
||||
@@ -301,21 +301,21 @@ def the_object_name_is_not_voided_by_void(name, void):
|
||||
|
||||
def the_object_name_is_not_voided(name):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
if any(element.HasOpenings):
|
||||
assert False, "An opening was found"
|
||||
|
||||
|
||||
def the_object_name_is_not_a_void(name):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
if any(element.VoidsElements):
|
||||
assert False, "A void was found"
|
||||
|
||||
|
||||
def the_void_name_is_filled_by_filling(name, filling):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
if any(rel.RelatedBuildingElement.Name == filling for rel in element.HasFillings):
|
||||
return True
|
||||
assert False, "No filling found"
|
||||
@@ -323,14 +323,14 @@ def the_void_name_is_filled_by_filling(name, filling):
|
||||
|
||||
def the_void_name_is_not_filled_by_filling(name, filling):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
if any(rel.RelatedBuildingElement.Name == filling for rel in element.HasFillings):
|
||||
assert False, "A filling was found"
|
||||
|
||||
|
||||
def the_object_name_is_not_a_filling(name):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
if any(element.FillsVoids):
|
||||
assert False, "A filling was found"
|
||||
|
||||
|
||||
@@ -718,8 +718,8 @@ def the_collection_exclude_status_is(name: str, exclude: str) -> None:
|
||||
@then(parsers.parse('the object "{name1}" and "{name2}" are different elements'))
|
||||
def the_object_name1_and_name2_are_different_elements(name1, name2):
|
||||
ifc = an_ifc_file_exists()
|
||||
element1 = ifc.by_id(the_object_name_exists(name1).BIMObjectProperties.ifc_definition_id)
|
||||
element2 = ifc.by_id(the_object_name_exists(name2).BIMObjectProperties.ifc_definition_id)
|
||||
element1 = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name1)))
|
||||
element2 = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name2)))
|
||||
assert element1 != element2, f"Objects {name1} and {name2} have same elements {element1} and {element2}"
|
||||
|
||||
|
||||
@@ -732,7 +732,7 @@ def the_object_name_has_a_body_of_value(name, value):
|
||||
@then(parsers.parse('the object "{name}" has a "{type}" representation of "{context}"'))
|
||||
def the_object_name_has_a_representation_type_of_context(name, type, context):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
context, subcontext, target_view = context.split("/")
|
||||
rep = ifcopenshell.util.representation.get_representation(element, context, subcontext or None, target_view or None)
|
||||
assert rep
|
||||
@@ -808,7 +808,7 @@ def the_object_name_should_display_as_mode(name, mode):
|
||||
@then(parsers.parse('the object "{name}" is voided by "{void}"'))
|
||||
def the_object_name_is_voided_by_void(name, void):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert any((rel for rel in element.HasOpenings if rel.RelatedOpeningElement.Name == void)), "No void found"
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@ def the_object_name_is_not_voided_by_void(name, void):
|
||||
@then(parsers.parse('the object "{name}" is not voided'))
|
||||
def the_object_name_is_not_voided(name):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert not element.HasOpenings, "A void was found"
|
||||
|
||||
|
||||
@@ -832,7 +832,7 @@ def the_object_name_is_not_voided(name):
|
||||
def the_object_name_is_a_void(name):
|
||||
ifc = tool.Ifc.get()
|
||||
obj = the_object_name_exists(name)
|
||||
element = ifc.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(obj))
|
||||
assert any((element.VoidsElements)), "No void was found"
|
||||
|
||||
|
||||
@@ -872,14 +872,14 @@ def the_object_name_is_not_visible(name):
|
||||
@then(parsers.parse('the object "{name}" is an "{ifc_class}"'))
|
||||
def the_object_name_is_an_ifc_class(name, ifc_class):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert element.is_a(ifc_class), f'Object "{name}" is an {element.is_a()}'
|
||||
|
||||
|
||||
@then(parsers.parse('the object "{name}" is not an IFC element'))
|
||||
def the_object_name_is_not_an_ifc_element(name):
|
||||
obj = the_object_name_exists(name)
|
||||
ifc_definition_id = obj.BIMObjectProperties.ifc_definition_id
|
||||
ifc_definition_id = tool.Blender.get_ifc_definition_id(obj)
|
||||
assert ifc_definition_id == 0, f"The object {obj} has an ID of {ifc_definition_id}"
|
||||
|
||||
|
||||
@@ -897,14 +897,14 @@ def the_object_name_has_ifc_representation_data(name):
|
||||
@then(parsers.parse('the material "{name}" is an IFC material'))
|
||||
def the_material_name_is_an_ifc_material(name):
|
||||
obj = the_material_name_exists(name)
|
||||
ifc_definition_id = obj.BIMObjectProperties.ifc_definition_id
|
||||
ifc_definition_id = tool.Blender.get_ifc_definition_id(obj)
|
||||
assert ifc_definition_id != 0, f"The material {obj} has no ID: {ifc_definition_id}"
|
||||
|
||||
|
||||
@then(parsers.parse('the material "{name}" is not an IFC material'))
|
||||
def the_material_name_is_not_an_ifc_material(name):
|
||||
obj = the_material_name_exists(name)
|
||||
ifc_definition_id = obj.BIMObjectProperties.ifc_definition_id
|
||||
ifc_definition_id = tool.Blender.get_ifc_definition_id(obj)
|
||||
assert ifc_definition_id == 0, f"The material {obj} has an ID of {ifc_definition_id}"
|
||||
|
||||
|
||||
@@ -937,7 +937,7 @@ def the_object_name_has_number_vertices(name, number):
|
||||
@then(parsers.parse('the void "{name}" is filled by "{filling}"'))
|
||||
def the_void_name_is_filled_by_filling(name, filling):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert any((rel.RelatedBuildingElement.Name == filling for rel in element.HasFillings)), "No filling found"
|
||||
|
||||
|
||||
@@ -954,7 +954,7 @@ def the_void_name_is_not_filled_by_filling(name, filling):
|
||||
@then(parsers.parse('the object "{name}" is not a filling'))
|
||||
def the_object_name_is_not_a_filling(name):
|
||||
ifc = tool.Ifc.get()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
assert not any(element.FillsVoids), "A filling was found"
|
||||
|
||||
|
||||
@@ -1010,8 +1010,9 @@ def prop_is_roughly_value(prop, value):
|
||||
def the_object_name_has_a_cartesian_point_offset_of_offset(name: str, offset: str) -> None:
|
||||
offset = replace_variables(offset)
|
||||
obj = the_object_name_exists(name)
|
||||
assert obj.BIMObjectProperties.blender_offset_type == "CARTESIAN_POINT"
|
||||
obj_offset = np.array(tuple(map(float, obj.BIMObjectProperties.cartesian_point_offset.split(","))))
|
||||
props = tool.Blender.get_object_props(obj)
|
||||
assert props.blender_offset_type == "CARTESIAN_POINT"
|
||||
obj_offset = np.array(tuple(map(float, props.cartesian_point_offset.split(","))))
|
||||
offset = np.array(tuple(map(float, offset.split(","))))
|
||||
assert np.allclose(obj_offset, offset)
|
||||
|
||||
@@ -1169,7 +1170,7 @@ def the_object_name_bottom_left_corner_is_at_location(name, location):
|
||||
@then(parsers.parse('the object "{name}" is contained in "{container_name}"'))
|
||||
def the_object_name_is_contained_in_container_name(name, container_name):
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
container = ifcopenshell.util.element.get_container(element)
|
||||
if not container:
|
||||
assert False, f'Object "{name}" is not in any container'
|
||||
@@ -1179,7 +1180,7 @@ def the_object_name_is_contained_in_container_name(name, container_name):
|
||||
@then(parsers.parse('the object "{name}" is contained in object "{container_name}"'))
|
||||
def the_object_name_is_contained_in_object_container_name(name: str, container_name: str) -> None:
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
container = ifcopenshell.util.element.get_container(element)
|
||||
if not container:
|
||||
assert False, f'Object "{name}" is not in any container'
|
||||
@@ -1190,7 +1191,7 @@ def the_object_name_is_contained_in_object_container_name(name: str, container_n
|
||||
@then(parsers.parse('the object "{name}" is aggregated by object "{aggregate_name}"'))
|
||||
def the_object_name_is_aggregated_by_object_aggregate_name(name: str, aggregate_name: str) -> None:
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
aggregate = ifcopenshell.util.element.get_aggregate(element)
|
||||
if not aggregate:
|
||||
assert False, f'Object "{name}" is not aggregated by any element'
|
||||
@@ -1201,7 +1202,7 @@ def the_object_name_is_aggregated_by_object_aggregate_name(name: str, aggregate_
|
||||
@then(parsers.parse('the object "{name}" has no aggregate'))
|
||||
def the_object_name_has_no_aggregate(name: str) -> None:
|
||||
ifc = an_ifc_file_exists()
|
||||
element = ifc.by_id(the_object_name_exists(name).BIMObjectProperties.ifc_definition_id)
|
||||
element = ifc.by_id(tool.Blender.get_ifc_definition_id(the_object_name_exists(name)))
|
||||
aggregate = ifcopenshell.util.element.get_aggregate(element)
|
||||
if aggregate:
|
||||
assert False, f'Object "{name}" is aggregated by element "{aggregate}"'
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.aggregate
|
||||
import ifcopenshell.util.element
|
||||
import bonsai.core.tool
|
||||
import bonsai.tool as tool
|
||||
@@ -167,7 +168,8 @@ class TestAssign(NewIfc):
|
||||
tool.Ifc.link(building_element, building_obj)
|
||||
building_collection = bpy.data.collections.new("Foobar")
|
||||
bpy.context.scene.collection.children.link(building_collection)
|
||||
building_obj.BIMObjectProperties.collection = building_collection
|
||||
props = tool.Blender.get_object_bim_props(building_obj)
|
||||
props.collection = building_collection
|
||||
building_collection.objects.link(building_obj)
|
||||
ifcopenshell.api.aggregate.assign_object(
|
||||
tool.Ifc.get(),
|
||||
|
||||
@@ -319,7 +319,8 @@ class TestGetDrawingCollection(NewFile):
|
||||
collection = bpy.data.collections.new("Collection")
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
collection.objects.link(obj)
|
||||
obj.BIMObjectProperties.collection = collection
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
props.collection = collection
|
||||
collection.BIMCollectionProperties.obj = obj
|
||||
|
||||
element = ifc.createIfcAnnotation()
|
||||
|
||||
@@ -170,22 +170,25 @@ class TestGetTextLiteral(NewFile):
|
||||
class TestGetCartesianPointCoordinateOffset(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMObjectProperties.blender_offset_type = "CARTESIAN_POINT"
|
||||
oprops = tool.Blender.get_object_bim_props(obj)
|
||||
oprops.blender_offset_type = "CARTESIAN_POINT"
|
||||
props = tool.Georeference.get_georeference_props()
|
||||
props.has_blender_offset = True
|
||||
obj.BIMObjectProperties.cartesian_point_offset = "1,2,3"
|
||||
oprops.cartesian_point_offset = "1,2,3"
|
||||
assert np.allclose(subject.get_cartesian_point_offset(obj), np.array((1.0, 2.0, 3.0)))
|
||||
|
||||
def test_get_null_if_not_a_cartesian_point_offset_type(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
props = tool.Georeference.get_georeference_props()
|
||||
props.has_blender_offset = True
|
||||
obj.BIMObjectProperties.cartesian_point_offset = "1,2,3"
|
||||
oprops = tool.Blender.get_object_bim_props(obj)
|
||||
oprops.cartesian_point_offset = "1,2,3"
|
||||
assert subject.get_cartesian_point_offset(obj) is None
|
||||
|
||||
def test_get_null_if_no_blender_offset(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMObjectProperties.blender_offset_type = "CARTESIAN_POINT"
|
||||
oprops = tool.Blender.get_object_bim_props(obj)
|
||||
oprops.blender_offset_type = "CARTESIAN_POINT"
|
||||
props = tool.Georeference.get_georeference_props()
|
||||
props.has_blender_offset = False
|
||||
assert subject.get_cartesian_point_offset(obj) is None
|
||||
@@ -307,15 +310,16 @@ class TestRecordObjectMaterials(NewFile):
|
||||
material.BIMStyleProperties.ifc_definition_id = style.id()
|
||||
obj.data.materials.append(material)
|
||||
subject.record_object_materials(obj)
|
||||
assert tool.Geometry.get_mesh_props(obj).material_checksum == str([style.id()])
|
||||
assert tool.Geometry.get_mesh_props(obj.data).material_checksum == str([style.id()])
|
||||
|
||||
|
||||
class TestRecordObjectPosition(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
subject.record_object_position(obj)
|
||||
assert obj.BIMObjectProperties.location_checksum == repr(np.array(obj.matrix_world.translation).tobytes())
|
||||
assert obj.BIMObjectProperties.rotation_checksum == repr(np.array(obj.matrix_world.to_3x3()).tobytes())
|
||||
assert props.location_checksum == repr(np.array(obj.matrix_world.translation).tobytes())
|
||||
assert props.rotation_checksum == repr(np.array(obj.matrix_world.to_3x3()).tobytes())
|
||||
|
||||
|
||||
class TestRemoveConnection(NewFile):
|
||||
|
||||
@@ -129,14 +129,16 @@ class TestGetEntity(test.bim.bootstrap.NewFile):
|
||||
|
||||
def test_attempting_without_a_file(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMObjectProperties.ifc_definition_id = 1
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
props.ifc_definition_id = 1
|
||||
assert subject.get_entity(obj) is None
|
||||
|
||||
def test_attempting_to_get_an_invalidly_linked_object(self):
|
||||
ifc = ifcopenshell.file()
|
||||
subject.set(ifc)
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMObjectProperties.ifc_definition_id = 1
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
props.ifc_definition_id = 1
|
||||
assert subject.get_entity(obj) is None
|
||||
|
||||
|
||||
|
||||
@@ -383,23 +383,26 @@ class TestUsingArrays(NewFile):
|
||||
|
||||
bpy.ops.mesh.primitive_cube_add()
|
||||
obj = bpy.context.active_object
|
||||
assert obj
|
||||
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()
|
||||
bpy.ops.bim.enable_editing_array(item=0)
|
||||
obj.BIMArrayProperties.count = 4
|
||||
obj.BIMArrayProperties.x = 4
|
||||
obj.BIMArrayProperties.sync_children = sync_children
|
||||
props = tool.Model.get_array_props(obj)
|
||||
props.count = 4
|
||||
props.x = 4
|
||||
props.sync_children = sync_children
|
||||
bpy.ops.bim.edit_array(item=0)
|
||||
|
||||
if add_second_layer:
|
||||
bpy.ops.bim.add_array()
|
||||
bpy.ops.bim.enable_editing_array(item=1)
|
||||
obj.BIMArrayProperties.count = 3
|
||||
obj.BIMArrayProperties.y = 4
|
||||
obj.BIMArrayProperties.sync_children = sync_children
|
||||
props = tool.Model.get_array_props(obj)
|
||||
props.count = 3
|
||||
props.y = 4
|
||||
props.sync_children = sync_children
|
||||
bpy.ops.bim.edit_array(item=1)
|
||||
|
||||
def test_remove_array_last_to_first(self):
|
||||
|
||||
@@ -54,6 +54,7 @@ class TestGetGlobalMatrix(test.bim.bootstrap.NewFile):
|
||||
props.blender_x_axis_abscissa = "0"
|
||||
props.blender_x_axis_ordinate = "1"
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMObjectProperties.blender_offset_type = "OBJECT_PLACEMENT"
|
||||
props = tool.Blender.get_object_bim_props(obj)
|
||||
props.blender_offset_type = "OBJECT_PLACEMENT"
|
||||
matrix = ifcopenshell.util.geolocation.local2global(np.array(obj.matrix_world), 1.0, 2.0, 3.0, 0.0, 1.0)
|
||||
assert (subject.get_absolute_matrix(obj) == matrix).all()
|
||||
|
||||
@@ -240,7 +240,7 @@ class TestImportUnitAttributes(NewFile):
|
||||
assert props.unit_attributes["UnitType"].enum_value == "ABSORBEDDOSEUNIT"
|
||||
assert props.unit_attributes["Prefix"].enum_value == "EXA"
|
||||
assert props.unit_attributes["Name"].enum_value == "AMPERE"
|
||||
assert props.unit_attributes["Dimensions"] is None
|
||||
assert "Dimensions" not in props.unit_attributes
|
||||
|
||||
|
||||
class TestImportUnits(NewFile):
|
||||
|
||||
Reference in New Issue
Block a user