From 39a34c1d27b3f392a30c7d3df5f9a99fa8885895 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 10 Jan 2018 12:10:32 -0200 Subject: [PATCH] Arch: Fixes in IFC exporter --- src/Mod/Arch/importIFC.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 72ad2f1f19..2563c133d4 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -1122,6 +1122,8 @@ def export(exportList,filename): if ifctype in translationtable.keys(): ifctype = translationtable[ifctype] ifctype = "Ifc" + ifctype + if ifctype == "IfcVisGroup": + ifctype = "IfcGroup" if ifctype == "IfcGroup": groups[obj.Name] = [o.Name for o in obj.Group] continue @@ -1164,7 +1166,10 @@ def export(exportList,filename): "InteriorOrExteriorSpace": "INTERNAL", "ElevationWithFlooring": obj.Shape.BoundBox.ZMin/1000.0}) elif ifctype == "IfcBuildingElementProxy": - kwargs.update({"CompositionType": "ELEMENT"}) + if ifcopenshell.schema_identifier == "IFC4": + kwargs.update({"PredefinedType": "ELEMENT"}) + else: + kwargs.update({"CompositionType": "ELEMENT"}) elif ifctype == "IfcSite": kwargs.update({"CompositionType": "ELEMENT"}) elif ifctype == "IfcBuilding": @@ -1177,6 +1182,7 @@ def export(exportList,filename): "BarLength": obj.Length.Value}) # creating the product + #print(obj.Label," : ",ifctype," : ",kwargs) product = getattr(ifcfile,"create"+ifctype)(**kwargs) products[obj.Name] = product