mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 15:07:38 +00:00
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:
@@ -455,6 +455,18 @@ class AddClassificationReferenceFromBSDD(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
reference.Location = bsdd_classification.uri
|
reference.Location = bsdd_classification.uri
|
||||||
|
|
||||||
for classification_pset in bprops.classification_psets:
|
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_")
|
is_pset = not classification_pset.name.startswith("Qto_")
|
||||||
|
|
||||||
if is_pset:
|
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
|
"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:
|
if is_pset:
|
||||||
ifcopenshell.api.run("pset.edit_pset", tool.Ifc.get(), pset=pset, properties=properties)
|
ifcopenshell.api.run("pset.edit_pset", tool.Ifc.get(), pset=pset, properties=properties)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user