Arch: ifc: fix import of archobj walls if structobj import is activated

This commit is contained in:
Bernd Hahnebach 2015-12-04 07:17:46 +01:00 committed by Yorik van Havre
parent 93b53f1662
commit 6d2877444c

View File

@ -328,12 +328,6 @@ def insert(filename,docname,skip=[],only=[],root=None):
settings.set(settings.USE_WORLD_COORDS,True)
if SEPARATE_OPENINGS:
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS,True)
if MERGE_MODE_STRUCT != 3:
try:
settings.set(settings.INCLUDE_CURVES,True)
except:
FreeCAD.Console.PrintError("Set INCLUDE_CURVES failed. IfcOpenShell seams to be an Outdated Developer Version.\n")
FreeCAD.Console.PrintError("Import of StructuralAnalysisView Entities will not work!\n")
sites = ifcfile.by_type("IfcSite")
buildings = ifcfile.by_type("IfcBuilding")
floors = ifcfile.by_type("IfcBuildingStorey")
@ -427,8 +421,10 @@ def insert(filename,docname,skip=[],only=[],root=None):
shape = None
archobj = True # assume all objects not in structuralifcobjects are architecture
structobj = False
if ptype in structuralifcobjects:
archobj = False
structobj = True
if DEBUG: print " (struct)",
else:
if DEBUG: print " (arch)",
@ -459,6 +455,10 @@ def insert(filename,docname,skip=[],only=[],root=None):
sharedobjects[bid] = None
store = bid
if structobj:
settings.set(settings.INCLUDE_CURVES,True)
else:
settings.set(settings.INCLUDE_CURVES,False)
try:
cr = ifcopenshell.geom.create_shape(settings,product)
brep = cr.geometry.brep_data
@ -474,10 +474,10 @@ def insert(filename,docname,skip=[],only=[],root=None):
shape.scale(1000.0) # IfcOpenShell always outputs in meters
if not shape.isNull():
if (MERGE_MODE_ARCH > 0 and archobj) or not archobj:
if (MERGE_MODE_ARCH > 0 and archobj) or structobj:
if ptype == "IfcSpace": # do not add spaces to compounds
if DEBUG: print "skipping space ",pid
elif not archobj:
elif structobj:
structshapes[pid] = shape
if DEBUG: print shape.Solids," ",
baseobj = shape