BIM: exportIFC.py fix UnboundLocalError

As shown in the image here:
https://github.com/FreeCAD/FreeCAD/issues/16485#issue-2523042111
This commit is contained in:
Roy-043
2024-09-16 11:00:53 +02:00
committed by Yorik van Havre
parent de0edd5b59
commit d282334099

View File

@@ -308,9 +308,9 @@ def export(exportList, filename, colors=None, preferences=None):
project = contextCreator.project
objectslist = [obj for obj in objectslist if obj != contextCreator.project_object]
if Draft.getObjectsOfType(objectslist, "Site"): # we assume one site and one representation context only
decl = Draft.getObjectsOfType(objectslist, "Site")[0].Declination.getValueAs(FreeCAD.Units.Radian)
contextCreator.model_context.TrueNorth.DirectionRatios = (math.cos(decl+math.pi/2), math.sin(decl+math.pi/2))
if Draft.getObjectsOfType(objectslist, "Site"): # we assume one site and one representation context only
decl = Draft.getObjectsOfType(objectslist, "Site")[0].Declination.getValueAs(FreeCAD.Units.Radian)
contextCreator.model_context.TrueNorth.DirectionRatios = (math.cos(decl+math.pi/2), math.sin(decl+math.pi/2))
# reusable entity system