diff --git a/src/blenderbim/blenderbim/tool/type.py b/src/blenderbim/blenderbim/tool/type.py index 37e294789a..acaa118abb 100644 --- a/src/blenderbim/blenderbim/tool/type.py +++ b/src/blenderbim/blenderbim/tool/type.py @@ -59,7 +59,13 @@ class Type(blenderbim.core.tool.Type): @classmethod def get_model_types(cls): - return tool.Ifc.get().by_type("IfcElementType") + ifc_file = tool.Ifc.get() + types = ifc_file.by_type("IfcElementType") + # exclude IfcSpatialElementType + types += ifc_file.by_type("IfcTypeProduct", include_subtypes=False) + types += ifc_file.by_type("IfcWindowStyle") + types += ifc_file.by_type("IfcDoorStyle") + return types @classmethod def get_object_data(cls, obj): diff --git a/src/blenderbim/test/tool/test_type.py b/src/blenderbim/test/tool/test_type.py index 5e49f0d487..4e3a7342f5 100644 --- a/src/blenderbim/test/tool/test_type.py +++ b/src/blenderbim/test/tool/test_type.py @@ -118,8 +118,9 @@ class TestGetModelTypes(NewFile): def test_run(self): ifc = ifcopenshell.file() tool.Ifc.set(ifc) - wall_type = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWallType") - assert subject.get_model_types() == [wall_type] + type_classes = ("IfcWallType", "IfcDoorStyle", "IfcWindowStyle", "IfcTypeProduct") + types = [ifcopenshell.api.run("root.create_entity", ifc, ifc_class=c) for c in type_classes] + assert set(subject.get_model_types()) == set(types) class TestGetObjectData(NewFile):