BIM: Only import TechDraw when its actually needed.

Allows FreeCAD BIM module to load without TechDraw module compiled.
This commit is contained in:
tritao
2025-01-11 22:29:36 +00:00
committed by Yorik van Havre
parent 0b1d7349b0
commit 13cc6a8d22

View File

@@ -986,7 +986,6 @@ class Component(ArchIFC.IfcProduct):
return
import Part
import TechDraw
import DraftGeomUtils
fmax = params.get_param_arch("MaxComputeAreas")
@@ -1022,6 +1021,7 @@ class Component(ArchIFC.IfcProduct):
pset = []
for f in fset:
try:
import TechDraw
pf = Part.Face(DraftGeomUtils.findWires(TechDraw.project(f,FreeCAD.Vector(0,0,1))[0].Edges))
except Part.OCCError:
# error in computing the areas. Better set them to zero than show a wrong value