diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index 6ff2edf8b5..2e6e4fcfec 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -177,7 +177,7 @@ class ids: for spec in self.specifications: self.ifc_applicable = 0 self.ifc_passed = 0 - for elem in ifc_file.by_type("IfcObject"): + for elem in ifc_file: apply, comply = spec(elem, logger) if apply: self.ifc_applicable += 1 @@ -211,7 +211,7 @@ class specification: """Represents the XML node and its two children and """ def __init__( - self, name="Unnamed", use="required", ifcVersion="IFC2X3", identifier=None, description=None, instructions=None + self, name="Unnamed", use="required", ifcVersion=["IFC2X3", "IFC4"], identifier=None, description=None, instructions=None ): """Create a specification to be added in ids. diff --git a/src/ifcopenshell-python/test/test_ids.py b/src/ifcopenshell-python/test/test_ids.py index 92434bd0fd..74ab5d47be 100644 --- a/src/ifcopenshell-python/test/test_ids.py +++ b/src/ifcopenshell-python/test/test_ids.py @@ -224,7 +224,7 @@ class TestIdsAuthoring(unittest.TestCase): assert spec.asdict() == { "@name": "Unnamed", "@use": "required", - "@ifcVersion": "IFC2X3", # :( + "@ifcVersion": ["IFC2X3", "IFC4"], "applicability": {}, "requirements": {}, } @@ -233,7 +233,7 @@ class TestIdsAuthoring(unittest.TestCase): spec = ids.specification( name="name", use="use", - ifcVersion="version", + ifcVersion="IFC4", identifier="identifier", description="description", instructions="instructions", @@ -241,7 +241,7 @@ class TestIdsAuthoring(unittest.TestCase): assert spec.asdict() == { "@name": "name", "@use": "use", - "@ifcVersion": "version", + "@ifcVersion": "IFC4", "@identifier": "identifier", "@description": "description", "@instructions": "instructions",