Arch: Added an IFC pref option to disable clones creation on import

This commit is contained in:
Yorik van Havre 2016-01-29 00:28:47 -02:00
parent 5fbdd4ac66
commit 3702820f00
3 changed files with 30 additions and 8 deletions

View File

@ -577,12 +577,13 @@ class Component:
base = base.fuse(add)
elif (Draft.getType(o) == "Window") or (Draft.isClone(o,"Window",True)):
f = o.Proxy.getSubVolume(o)
if f:
if base.Solids and f.Solids:
if placement:
f.Placement = f.Placement.multiply(placement)
base = base.cut(f)
if hasattr(o.Proxy,"getSubVolume"):
f = o.Proxy.getSubVolume(o)
if f:
if base.Solids and f.Solids:
if placement:
f.Placement = f.Placement.multiply(placement)
base = base.cut(f)
elif o.isDerivedFrom("Part::Feature"):
if o.Shape:

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>456</width>
<height>478</height>
<height>486</height>
</rect>
</property>
<property name="windowTitle">
@ -255,6 +255,26 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_6">
<property name="text">
<string>Create clones when objects have shared geometry</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ifcCreateClones</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>

View File

@ -304,6 +304,7 @@ def insert(filename,docname,skip=[],only=[],root=None):
GET_EXTRUSIONS = False
if not SEPARATE_OPENINGS:
SKIP.append("IfcOpeningElement")
CREATE_CLONES = p.GetBool("ifcCreateClones",True)
try:
import ifcopenshell
@ -451,7 +452,7 @@ def insert(filename,docname,skip=[],only=[],root=None):
prepr = product.Representation
except:
if DEBUG: print " ERROR unable to get object representation",
if prepr and (MERGE_MODE_ARCH == 0) and archobj:
if prepr and (MERGE_MODE_ARCH == 0) and archobj and CREATE_CLONES:
for s in prepr.Representations:
if s.RepresentationIdentifier.upper() == "BODY":
if s.Items[0].is_a("IfcMappedItem"):