Handle RuntimeError in alignment geometry generation

Add RuntimeError handling for IfcOpenShell versions that don't support
the piecewise-step-type setting in geometry generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
DesertSpringsCivil
2026-02-01 18:40:49 -07:00
parent de2a7c9527
commit 6294c35a11
2 changed files with 6 additions and 2 deletions
@@ -90,7 +90,10 @@ def generate_vertices(rep_curve: entity_instance, distance_interval: float = 5.0
)
s = ifcopenshell.geom.settings()
s.set("piecewise-step-type", 0) # 0 = step-size is maximum step size, 1 = step-size is mininimum number of steps
try:
s.set("piecewise-step-type", 0) # 0 = step-size is maximum step size, 1 = step-size is mininimum number of steps
except RuntimeError:
pass # Setting not available in older IfcOpenShell versions
s.set("piecewise-step-size", distance_interval)
shape = ifcopenshell.geom.create_shape(s, rep_curve)
vertices = shape.verts