Arch: IFC import, better debug message for skipped objs in non parametric import mode

This commit is contained in:
Bernd Hahnebach
2019-10-07 21:48:01 +02:00
parent f6d4c06ce9
commit f5768441a6

View File

@@ -648,6 +648,7 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
for freecadtype,ifctypes in typesmap.items():
if ptype in ifctypes:
obj = getattr(Arch,"make"+freecadtype)(baseobj=baseobj,name=name)
if preferences['DEBUG']: print(": "+obj.Label+" ",end="")
if ptype == "IfcBuildingStorey":
if product.Elevation:
obj.Placement.Base.z = product.Elevation * ifcscale
@@ -667,6 +668,9 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
a = obj.IfcData
a["IfcUID"] = str(guid)
obj.IfcData = a
else:
if preferences['DEBUG']: print(": skipped.")
continue
elif (preferences['MERGE_MODE_ARCH'] == 2 and archobj) or (preferences['MERGE_MODE_STRUCT'] == 1 and not archobj):
@@ -676,12 +680,16 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None):
for freecadtype,ifctypes in typesmap.items():
if ptype in ifctypes:
obj = getattr(Arch,"make"+freecadtype)(baseobj=baseobj,name=name)
if preferences['DEBUG']: print(": "+obj.Label+" ",end="")
if ptype == "IfcBuildingStorey":
if product.Elevation:
obj.Placement.Base.z = product.Elevation * ifcscale
elif baseobj:
obj = FreeCAD.ActiveDocument.addObject("Part::Feature",name)
obj.Shape = shape
else:
if preferences['DEBUG']: print(": skipped.")
continue
if preferences['DEBUG']: print("") # newline for debug prints, print for a new object should be on a new line