Skip to content

Commit

Permalink
BIM: exportIFC.py fix UnboundLocalError
Browse files Browse the repository at this point in the history
As shown in the image here:
FreeCAD#16485 (comment)
  • Loading branch information
Roy-043 authored and yorikvanhavre committed Sep 16, 2024
1 parent fdb72e8 commit 79c6949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mod/BIM/importers/exportIFC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 79c6949

Please sign in to comment.