mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
Ifc text tweaks (#2431)
* added 3"=1'-0" scale (a common scale), and corrected 6"=1'-0" scale * Allow float point values in smart tags, and avoid breaking when no assigned product See #2340, #2349
This commit is contained in:
@@ -528,8 +528,9 @@ class SvgWriter:
|
||||
product = tool.Drawing.get_assigned_product(element)
|
||||
selector = ifcopenshell.util.selector.Selector
|
||||
variables = {}
|
||||
for variable in re.findall("{{.*?}}", literal):
|
||||
literal = literal.replace(variable, selector.get_element_value(product, variable[2:-2]) or "")
|
||||
if product != None:
|
||||
for variable in re.findall("{{.*?}}", literal):
|
||||
literal = literal.replace(variable, str(selector.get_element_value(product, variable[2:-2]) or ""))
|
||||
|
||||
for line_number, text_line in enumerate(literal.replace("\\n", "\n").split("\n")):
|
||||
self.svg.add(
|
||||
|
||||
@@ -422,7 +422,7 @@ class Drawing(blenderbim.core.tool.Drawing):
|
||||
selector = ifcopenshell.util.selector.Selector()
|
||||
variables = {}
|
||||
for variable in re.findall("{{.*?}}", value):
|
||||
value = value.replace(variable, selector.get_element_value(product, variable[2:-2]) or "")
|
||||
value = value.replace(variable, str(selector.get_element_value(product, variable[2:-2]) or ""))
|
||||
obj.BIMTextProperties.value = value
|
||||
|
||||
# TODO below this point is highly experimental prototype code with no tests
|
||||
|
||||
Reference in New Issue
Block a user