Arch: import IFC, fix View Fit while importing

This commit is contained in:
Bernd Hahnebach
2017-10-21 14:28:15 +02:00
committed by wmayer
parent 3e9d9ab428
commit 4b02d814bb

View File

@@ -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="")