From a32735ac6a52a0d3503e254598e1907af3291dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Tue, 11 Mar 2025 14:04:34 -0300 Subject: [PATCH] Small fix after 7af672712f5413ee66ed39bc2fac4aa0f0c3d4a0 --- src/bonsai/bonsai/tool/snap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/tool/snap.py b/src/bonsai/bonsai/tool/snap.py index e99f99b929..f7f49d2307 100644 --- a/src/bonsai/bonsai/tool/snap.py +++ b/src/bonsai/bonsai/tool/snap.py @@ -161,7 +161,10 @@ class Snap(bonsai.core.tool.Snap): # We multiply by the increment snap which is based on the viewport zoom snap_threshold = 1 * cls.get_increment_snap_value(bpy.context) - default_container_elevation = tool.Ifc.get_object(tool.Root.get_default_container()).location.z + if tool.Ifc.get(): + default_container_elevation = tool.Ifc.get_object(tool.Root.get_default_container()).location.z + else: + default_container_elevation = 0.0 polyline_data = bpy.context.scene.BIMPolylineProperties.insertion_polyline polyline_points = polyline_data[0].polyline_points if polyline_data else [] if polyline_points: