mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
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:
@@ -96,6 +96,7 @@ class Bsdd(bonsai.core.tool.Bsdd):
|
|||||||
|
|
||||||
psets = {}
|
psets = {}
|
||||||
for prop in properties:
|
for prop in properties:
|
||||||
|
# prop is ClassPropertyContract.
|
||||||
if prop.get("propertyDictionaryName") != "IFC":
|
if prop.get("propertyDictionaryName") != "IFC":
|
||||||
continue
|
continue
|
||||||
pset = prop.get("propertySet", None)
|
pset = prop.get("propertySet", None)
|
||||||
@@ -111,8 +112,10 @@ class Bsdd(bonsai.core.tool.Bsdd):
|
|||||||
possible_values = [v["value"] for v in possible_values]
|
possible_values = [v["value"] for v in possible_values]
|
||||||
|
|
||||||
description = prop.get("description", "")
|
description = prop.get("description", "")
|
||||||
|
# Prefer propertyCode as it's later will be used to set properties,
|
||||||
psets[pset][prop["name"]] = {
|
# 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"],
|
"data_type": prop["dataType"],
|
||||||
"possible_values": possible_values,
|
"possible_values": possible_values,
|
||||||
"description": description,
|
"description": description,
|
||||||
|
|||||||
Reference in New Issue
Block a user