Example #1
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     reference = ifc.createIfcLibraryReference()
     subject.set_active_reference(reference)
     assert bpy.context.scene.BIMLibraryProperties.active_reference_id == reference.id(
     )
Example #2
0
 def test_run(self):
     ifc = ifcopenshell.file()
     tool.Ifc.set(ifc)
     library = ifc.createIfcLibraryInformation()
     subject.set_active_library(library)
     assert bpy.context.scene.BIMLibraryProperties.active_library_id == library.id(
     )
Example #3
0
 def test_run(self):
     ifc = ifcopenshell.file()
     library = ifc.createIfcLibraryInformation()
     reference = ifc.createIfcLibraryReference(Name="Reference",
                                               ReferencedLibrary=library)
     subject.import_references(library)
     props = bpy.context.scene.BIMLibraryProperties
     assert props.references[0].ifc_definition_id == reference.id()
     assert props.references[0].name == "Reference"
Example #4
0
 def test_run(self):
     ifc = ifcopenshell.file()
     reference = ifc.createIfcLibraryReference("Location", "Identification",
                                               "Name", "Description",
                                               "Language")
     subject.import_reference_attributes(reference)
     props = bpy.context.scene.BIMLibraryProperties
     assert props.reference_attributes.get(
         "Location").string_value == "Location"
     assert props.reference_attributes.get(
         "Identification").string_value == "Identification"
     assert props.reference_attributes.get("Name").string_value == "Name"
     assert props.reference_attributes.get(
         "Description").string_value == "Description"
     assert props.reference_attributes.get(
         "Language").string_value == "Language"
Example #5
0
 def test_run(self):
     ifc = ifcopenshell.file()
     library = ifc.createIfcLibraryInformation("Name", "Version", None,
                                               "VersionDate", "Location",
                                               "Description")
     subject.import_library_attributes(library)
     props = bpy.context.scene.BIMLibraryProperties
     assert props.library_attributes.get("Name").string_value == "Name"
     assert props.library_attributes.get(
         "Version").string_value == "Version"
     assert props.library_attributes.get(
         "VersionDate").string_value == "VersionDate"
     assert props.library_attributes.get(
         "Location").string_value == "Location"
     assert props.library_attributes.get(
         "Description").string_value == "Description"
Example #6
0
 def test_run(self):
     TestImportReferenceAttributes().test_run()
     assert subject.export_reference_attributes() == {
         "Location": "Location",
         "Identification": "Identification",
         "Name": "Name",
         "Description": "Description",
         "Language": "Language",
     }
Example #7
0
 def test_run(self):
     TestImportLibraryAttributes().test_run()
     assert subject.export_library_attributes() == {
         "Name": "Name",
         "Version": "Version",
         "VersionDate": "VersionDate",
         "Location": "Location",
         "Description": "Description",
     }
Example #8
0
 def test_run(self):
     TestSetActiveReference().test_run()
     assert subject.get_active_reference().is_a("IfcLibraryReference")
Example #9
0
 def test_run(self):
     TestSetActiveLibrary().test_run()
     assert subject.get_active_library().is_a("IfcLibraryInformation")
Example #10
0
 def test_run(self):
     props = bpy.context.scene.BIMLibraryProperties
     props.editing_mode = "foo"
     subject.clear_editing_mode()
     assert props.editing_mode == ""
Example #11
0
 def test_run(self):
     subject.set_editing_mode("FOO")
     assert bpy.context.scene.BIMLibraryProperties.editing_mode == "FOO"