mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Fix error reassigning class for structural items
This commit is contained in:
@@ -54,27 +54,8 @@ class IfcClassData:
|
||||
|
||||
@classmethod
|
||||
def ifc_products(cls):
|
||||
products = [
|
||||
"IfcElementType",
|
||||
"IfcElement",
|
||||
"IfcFeatureElement",
|
||||
"IfcSpatialElement",
|
||||
"IfcSpatialElementType",
|
||||
"IfcStructuralItem",
|
||||
"IfcAnnotation",
|
||||
"IfcRelSpaceBoundary",
|
||||
]
|
||||
products = tool.Root.get_ifc_products()
|
||||
version = tool.Ifc.get_schema()
|
||||
if version == "IFC2X3":
|
||||
products = [
|
||||
"IfcElementType",
|
||||
"IfcElement",
|
||||
"IfcFeatureElement",
|
||||
"IfcSpatialStructureElement",
|
||||
"IfcStructuralItem",
|
||||
"IfcAnnotation",
|
||||
"IfcRelSpaceBoundary",
|
||||
]
|
||||
return [(e, e, (get_entity_doc(version, e) or {}).get("description", "")) for e in products]
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -48,17 +48,7 @@ class EnableReassignClass(bpy.types.Operator):
|
||||
assert element
|
||||
ifc_class = element.is_a()
|
||||
context.active_object.BIMObjectProperties.is_reassigning_class = True
|
||||
ifc_products = [
|
||||
"IfcElement",
|
||||
"IfcElementType",
|
||||
"IfcSpatialElement",
|
||||
"IfcGroup",
|
||||
"IfcStructural",
|
||||
"IfcPositioningElement",
|
||||
"IfcContext",
|
||||
"IfcAnnotation",
|
||||
"IfcRelSpaceBoundary",
|
||||
]
|
||||
ifc_products = tool.Root.get_ifc_products()
|
||||
schema = tool.Ifc.schema()
|
||||
declaration = schema.declaration_by_name(ifc_class)
|
||||
for ifc_product in ifc_products:
|
||||
|
||||
@@ -429,3 +429,29 @@ class Root(bonsai.core.tool.Root):
|
||||
tool.Ifc.unlink(obj=material)
|
||||
if "Ifc" in obj.name and "/" in obj.name:
|
||||
obj.name = obj.name.split("/", 1)[1]
|
||||
|
||||
@classmethod
|
||||
def get_ifc_products(cls) -> tuple[str, ...]:
|
||||
version = tool.Ifc.get_schema()
|
||||
if version == "IFC2X3":
|
||||
products = (
|
||||
"IfcElementType",
|
||||
"IfcElement",
|
||||
"IfcFeatureElement",
|
||||
"IfcSpatialStructureElement",
|
||||
"IfcStructuralItem",
|
||||
"IfcAnnotation",
|
||||
"IfcRelSpaceBoundary",
|
||||
)
|
||||
else:
|
||||
products = (
|
||||
"IfcElementType",
|
||||
"IfcElement",
|
||||
"IfcFeatureElement",
|
||||
"IfcSpatialElement",
|
||||
"IfcSpatialElementType",
|
||||
"IfcStructuralItem",
|
||||
"IfcAnnotation",
|
||||
"IfcRelSpaceBoundary",
|
||||
)
|
||||
return products
|
||||
|
||||
Reference in New Issue
Block a user