Arch: Also skip default storey when importing IFC with 'replace by group' option

This commit is contained in:
Yorik van Havre
2020-04-21 14:46:07 +02:00
parent 32d73bca15
commit ea5211e5d3
2 changed files with 7 additions and 2 deletions

View File

@@ -388,10 +388,10 @@ FreeCAD object properties</string>
<item>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="toolTip">
<string>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</string>
<string>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.</string>
</property>
<property name="text">
<string>Replace Project, Site and Buiding by Group</string>
<string>Replace Project, Site, Buiding and Storey by Group</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ifcReplaceProject</cstring>

View File

@@ -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