From ea5211e5d38bcd032dc1207e5b56a4b7bf2d2877 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 21 Apr 2020 14:46:07 +0200 Subject: [PATCH] Arch: Also skip default storey when importing IFC with 'replace by group' option --- src/Mod/Arch/Resources/ui/preferences-ifc.ui | 4 ++-- src/Mod/Arch/importIFC.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/Resources/ui/preferences-ifc.ui b/src/Mod/Arch/Resources/ui/preferences-ifc.ui index 632689be18..e11ea0d3c8 100644 --- a/src/Mod/Arch/Resources/ui/preferences-ifc.ui +++ b/src/Mod/Arch/Resources/ui/preferences-ifc.ui @@ -388,10 +388,10 @@ FreeCAD object properties - If this option is checked, the default Project, Site and Building objects that are usually found in an IFC file are not imported, and all objects are placed in a Group + If this option is checked, the default Project, Site, Building and Storeys objects that are usually found in an IFC file are not imported, and all objects are placed in a Group. Buildins ans storeys are still imported if there is more than one. - Replace Project, Site and Buiding by Group + Replace Project, Site, Buiding and Storey by Group ifcReplaceProject diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index dbc09b5f2b..299a08ee28 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -393,6 +393,11 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None): # let multiple buildings through... if preferences['DEBUG']: print(" skipped.") continue + elif ptype in ['IfcBuildingStorey']: + if len(ifcfile.by_type("IfcBuildingStorey")) == 1: + # let multiple storeys through... + if preferences['DEBUG']: print(" skipped.") + continue # check if this object is sharing its shape (mapped representation) clone = None