From 09fe85e8ff6de19d5261701dd21d9a0cd9d74af8 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Sat, 21 Oct 2017 14:28:15 +0200 Subject: [PATCH] Arch: import IFC, fix View Fit while importing --- src/Mod/Arch/importIFC.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 9c76072b3e..ddafb01bf1 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -569,21 +569,21 @@ def insert(filename,docname,skip=[],only=[],root=None): shape.scale(1000.0) # IfcOpenShell always outputs in meters - if FITVIEW_ONIMPORT and FreeCAD.GuiUp: - try: - bb = shape.BoundBox - # if DEBUG: print(' ' + str(bb),end="") - except: - bb = None - if DEBUG: print(' BB could not be computed',end="") - if bb: - if not overallboundbox: - overallboundbox = bb - if not overallboundbox.isInside(bb): - FreeCADGui.SendMsgToActiveView("ViewFit") + if not shape.isNull(): + if FITVIEW_ONIMPORT and FreeCAD.GuiUp: + try: + bb = shape.BoundBox + # if DEBUG: print(' ' + str(bb),end="") + except: + bb = None + if DEBUG: print(' BB could not be computed',end="") + if bb.isValid(): + if not overallboundbox: + overallboundbox = bb + if not overallboundbox.isInside(bb): + FreeCADGui.SendMsgToActiveView("ViewFit") overallboundbox.add(bb) - if not shape.isNull(): if (MERGE_MODE_ARCH > 0 and archobj) or structobj: if ptype == "IfcSpace": # do not add spaces to compounds if DEBUG: print("skipping space ",pid,end="")