Fix bug where you couldn't manage spatial types in the type manager

This commit is contained in:
Dion Moult
2023-02-27 20:10:27 +11:00
parent 131ee8270b
commit d9b54c923c
2 changed files with 9 additions and 2 deletions
@@ -68,7 +68,14 @@ class AuthoringData:
declaration = tool.Ifc.schema().declaration_by_name("IfcElementType")
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
names = [d.name() for d in declarations]
names.extend(("IfcDoorStyle", "IfcWindowStyle"))
declaration = tool.Ifc.schema().declaration_by_name("IfcSpatialElementType")
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
names.extend([d.name() for d in declarations])
if tool.Ifc.get_schema() in ("IFC2X3", "IFC4"):
names.extend(("IfcDoorStyle", "IfcWindowStyle"))
version = tool.Ifc.get_schema()
return [(c, c, get_entity_doc(version, c).get("description", "")) for c in sorted(names)]
@@ -148,7 +148,7 @@ class FilledOpeningGenerator:
def regenerate_from_type(self, usecase_path, ifc_file, settings):
filling = settings["related_object"]
if not filling.FillsVoids:
if not getattr(filling, "FillsVoids", None):
return
opening = filling.FillsVoids[0].RelatingOpeningElement