コード例 #1
0
 def test_importing_twice(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     context = ifc.createIfcGeometricRepresentationContext()
     context.ContextIdentifier = "ContextIdentifier"
     subject.set_context(context)
     subject.import_attributes()
     context.ContextIdentifier = "ContextIdentifier2"
     subject.import_attributes()
     props = bpy.context.scene.BIMContextProperties
     assert props.context_attributes.get(
         "ContextIdentifier").string_value == "ContextIdentifier2"
コード例 #2
0
 def test_importing_a_subcontext(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     subcontext = ifc.createIfcGeometricRepresentationSubcontext()
     subcontext.TargetScale = 0.5
     subcontext.TargetView = "NOTDEFINED"
     subcontext.UserDefinedTargetView = "UserDefinedTargetView"
     subject.set_context(subcontext)
     subject.import_attributes()
     props = bpy.context.scene.BIMContextProperties
     assert props.context_attributes.get("TargetScale").float_value == 0.5
     assert props.context_attributes.get(
         "TargetView").enum_value == "NOTDEFINED"
     assert props.context_attributes.get(
         "UserDefinedTargetView").string_value == "UserDefinedTargetView"
     assert not props.context_attributes.get("Precision")
コード例 #3
0
 def test_importing_a_context(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     context = ifc.createIfcGeometricRepresentationContext()
     context.ContextIdentifier = "ContextIdentifier"
     context.ContextType = "ContextType"
     context.CoordinateSpaceDimension = 1
     context.Precision = 1
     subject.set_context(context)
     subject.import_attributes()
     props = bpy.context.scene.BIMContextProperties
     assert props.context_attributes.get(
         "ContextIdentifier").string_value == "ContextIdentifier"
     assert props.context_attributes.get(
         "ContextType").string_value == "ContextType"
     assert props.context_attributes.get(
         "CoordinateSpaceDimension").int_value == 1
     assert props.context_attributes.get("Precision").float_value == 1
コード例 #4
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     context = ifc.createIfcGeometricRepresentationContext()
     subject.set_context(context)
     assert subject.get_context() == context
コード例 #5
0
 def test_run(self):
     ifc = ifcopenshell.file()
     context = ifc.createIfcGeometricRepresentationContext()
     subject.set_context(context)
     assert bpy.context.scene.BIMContextProperties.active_context_id == context.id(
     )