From d4ccadb8329b6b381c430ac2a1246c87a8b3e9c3 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 8 May 2024 18:13:01 +0500 Subject: [PATCH] fix circular import after 10d30b0de --- .../ifcopenshell/api/geometry/add_representation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py index 6c9a8da058..fee0dc7dd1 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py @@ -15,13 +15,13 @@ # # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . - +from __future__ import annotations import bpy import math import bmesh import ifcopenshell.util.unit from mathutils import Vector, Matrix -from blenderbim.bim.module.geometry.helper import Helper + Z_AXIS = Vector((0, 0, 1)) X_AXIS = Vector((1, 0, 0)) @@ -29,6 +29,10 @@ EPSILON = 1e-6 def add_representation(file: ifcopenshell.file, **usecase_settings) -> ifcopenshell.entity_instance: + # lazy import Helper to avoid circular import + if "Helper" not in globals(): + from blenderbim.bim.module.geometry.helper import Helper + usecase = Usecase() # TODO: This usecase currently depends on Blender's data model usecase.file = file