add classification reference from bsdd - support ObjectType

it seems in bsdd some ObjectType is also provided using "undefined_set" pset
example - https://identifier.buildingsmart.org/uri/ifcairport/ifcairport/1.0/class/ifcairport0000000004
This commit is contained in:
Andrej730
2024-09-18 17:53:51 +05:00
parent 115a48fc1a
commit 5b2733bb3c
@@ -455,6 +455,18 @@ class AddClassificationReferenceFromBSDD(bpy.types.Operator, tool.Ifc.Operator):
reference.Location = bsdd_classification.uri
for classification_pset in bprops.classification_psets:
properties = {}
for prop in classification_pset.properties:
properties[prop.name] = prop.get_value()
if classification_pset.name == "undefined_set":
if "ObjectType" in properties:
if hasattr(element, "ObjectType"):
element.ObjectType = properties["ObjectType"]
del properties["ObjectType"]
if not properties:
continue
is_pset = not classification_pset.name.startswith("Qto_")
if is_pset:
@@ -473,10 +485,6 @@ class AddClassificationReferenceFromBSDD(bpy.types.Operator, tool.Ifc.Operator):
"pset.add_qto", tool.Ifc.get(), product=element, name=classification_pset.name
)
properties = {}
for prop in classification_pset.properties:
properties[prop.name] = prop.get_value()
if is_pset:
ifcopenshell.api.run("pset.edit_pset", tool.Ifc.get(), pset=pset, properties=properties)
else: