Esempio n. 1
0
 def test_importing_monetary_units(self):
     ifc = ifcopenshell.file()
     unit = ifc.createIfcMonetaryUnit()
     unit.Currency = "Currency"
     subject.import_unit_attributes(unit)
     props = bpy.context.scene.BIMUnitProperties
     assert props.unit_attributes.get("Currency").string_value == "Currency"
Esempio n. 2
0
 def test_importing_monetary_units_ifc2x3(self):
     ifc = ifcopenshell.file(schema="IFC2X3")
     unit = ifc.createIfcMonetaryUnit()
     unit.Currency = "USD"
     subject.import_unit_attributes(unit)
     props = bpy.context.scene.BIMUnitProperties
     assert props.unit_attributes.get("Currency").enum_value == "USD"
Esempio n. 3
0
 def test_importing_derived_units(self):
     ifc = ifcopenshell.file()
     unit = ifc.createIfcDerivedUnit()
     unit.UnitType = "ANGULARVELOCITYUNIT"
     unit.UserDefinedType = "UserDefinedType"
     subject.import_unit_attributes(unit)
     props = bpy.context.scene.BIMUnitProperties
     assert props.unit_attributes.get(
         "UnitType").enum_value == "ANGULARVELOCITYUNIT"
     assert props.unit_attributes.get(
         "UserDefinedType").string_value == "UserDefinedType"
Esempio n. 4
0
 def test_importing_si_units(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     unit = ifc.createIfcSIUnit()
     unit.UnitType = "ABSORBEDDOSEUNIT"
     unit.Prefix = "EXA"
     unit.Name = "AMPERE"
     subject.import_unit_attributes(unit)
     props = bpy.context.scene.BIMUnitProperties
     assert props.unit_attributes.get(
         "UnitType").enum_value == "ABSORBEDDOSEUNIT"
     assert props.unit_attributes.get("Prefix").enum_value == "EXA"
     assert props.unit_attributes.get("Name").enum_value == "AMPERE"
     assert props.unit_attributes.get("Dimensions") is None
Esempio n. 5
0
 def test_importing_conversion_based_units(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     unit = ifc.createIfcConversionBasedUnit()
     unit.UnitType = "ABSORBEDDOSEUNIT"
     unit.Name = "Name"
     unit.Dimensions = ifc.createIfcDimensionalExponents(
         1, 2, 3, 4, 5, 6, 7)
     subject.import_unit_attributes(unit)
     props = bpy.context.scene.BIMUnitProperties
     assert props.unit_attributes.get(
         "UnitType").enum_value == "ABSORBEDDOSEUNIT"
     assert props.unit_attributes.get("Name").string_value == "Name"
     assert props.unit_attributes.get(
         "Dimensions").string_value == "[1, 2, 3, 4, 5, 6, 7]"