mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Prioritize existing data types for templates props for safety
Noticed working on #5596 and #5708 a few issue when pset template is changing the prop types. E.g. prop had string data type and now template suggests that it should be a float. Previously, it might error trying to cast a string to a float. Now it will show a float until user will set it to null, then next time it will be loaded from the template data type. Another example - prop was a string and now it's a boolean. Previously, it would be cast to boolean implicitly. E.g. "test" -> bool("test") -> True. And if user wouldn't be paying attention then enabling pset editing and saving it would make them lose "test" value. Now - https://imgchest.com/p/na7ke99wb78 Before - https://imgchest.com/p/5xy23rr3z4l
This commit is contained in:
@@ -394,6 +394,7 @@ def get_properties(
|
||||
"id": prop.id(),
|
||||
"class": prop.is_a(),
|
||||
"value": results[prop_name],
|
||||
"value_type": v.is_a() if v else None,
|
||||
}
|
||||
elif ifc_class == "IfcPropertyEnumeratedValue":
|
||||
# 2 IfcPropertyEnumeratedValue.EnumerationValues
|
||||
|
||||
Reference in New Issue
Block a user