bsdd - fix bug when loading pset would set properties in incorrect way

It was using name instead of propertyCode which was leading to assigning incorrect properties...
This commit is contained in:
Andrej730
2024-09-18 17:52:33 +05:00
parent 06d927f8bb
commit 115a48fc1a
+5 -2
View File
@@ -96,6 +96,7 @@ class Bsdd(bonsai.core.tool.Bsdd):
psets = {}
for prop in properties:
# prop is ClassPropertyContract.
if prop.get("propertyDictionaryName") != "IFC":
continue
pset = prop.get("propertySet", None)
@@ -111,8 +112,10 @@ class Bsdd(bonsai.core.tool.Bsdd):
possible_values = [v["value"] for v in possible_values]
description = prop.get("description", "")
psets[pset][prop["name"]] = {
# Prefer propertyCode as it's later will be used to set properties,
# so name should be exact. Fallback to name as propertyCode is nullable.
prop_name = prop.get("propertyCode") or prop["name"]
psets[pset][prop_name] = {
"data_type": prop["dataType"],
"possible_values": possible_values,
"description": description,