Fix #2881. Support added for referencing nested relationships and material set items.

This commit is contained in:
Dion Moult
2023-03-25 22:07:18 +11:00
parent df0a503b89
commit b9c99b35a5
3 changed files with 79 additions and 18 deletions
+4 -3
View File
@@ -1042,9 +1042,10 @@ class Drawing(blenderbim.core.tool.Drawing):
if not product:
return text
for variable in re.findall("{{.*?}}", text):
text = text.replace(
variable, str(ifcopenshell.util.selector.get_element_value(product, variable[2:-2]) or "")
)
value = ifcopenshell.util.selector.get_element_value(product, variable[2:-2])
if isinstance(value, (list, tuple)):
value = ", ".join(str(v) for v in value)
text = text.replace(variable, str(value))
return text
@classmethod