From ef5d4b8370eb93c33001c5b43f8c41ea7db203b6 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Wed, 21 Aug 2019 09:25:31 +0200 Subject: [PATCH] Arch: import IFC, get back description of empty relation tables --- src/Mod/Arch/importIFC.py | 12 ++++++++++-- src/Mod/Arch/importIFCHelper.py | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 1909990e1c..c3ab0e3bff 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -290,14 +290,22 @@ def insert(filename,docname,skip=[],only=[],root=None): settings.set(settings.APPLY_LAYERSETS,True) # build all needed tables - if DEBUG: print("Building relationships table...",end="") - objects, shapes, structshapes, sharedobjects, parametrics, profiles = {}, {}, {}, {}, {}, {} + if DEBUG: print("Building types and relationships table...",end="") + # type tables sites = ifcfile.by_type("IfcSite") buildings = ifcfile.by_type("IfcBuilding") floors = ifcfile.by_type("IfcBuildingStorey") openings = ifcfile.by_type("IfcOpeningElement") materials = ifcfile.by_type("IfcMaterial") products, annotations = importIFCHelper.buildRelProductsAnnotations(ifcfile, ROOT_ELEMENT) + # empty relation tables + objects = {} # { id:object, ... } + shapes = {} # { id:shaoe } only used for merge mode + structshapes = {} # { id:shaoe } only used for merge mode + sharedobjects = {} # { representationmapid:object } + parametrics = [] # a list of imported objects whose parametric relationships need processing after all objects have been created + profiles = {} # to store reused extrusion profiles {ifcid:fcobj,...} + # filled relation tables # TODO for the following tables might be better use inverse attributes, done for properties # see https://forum.freecadweb.org/viewtopic.php?f=39&t=37892 prodrepr = importIFCHelper.buildRelProductRepresentation(ifcfile) diff --git a/src/Mod/Arch/importIFCHelper.py b/src/Mod/Arch/importIFCHelper.py index c8d0c6995e..c9e99f7542 100644 --- a/src/Mod/Arch/importIFCHelper.py +++ b/src/Mod/Arch/importIFCHelper.py @@ -77,7 +77,7 @@ class ProjectImporter: return round(math.degrees(math.atan2(y, x)) - 90, 6) -# relation tables +# type tables def buildRelProductsAnnotations(ifcfile, root_element): """build the products and annotations relation table and""" @@ -99,6 +99,7 @@ def buildRelProductsAnnotations(ifcfile, root_element): return products, annotations +# relation tables def buildRelProductRepresentation(ifcfile): """build the product/representations relation table"""