Arch: Added IFC export option to disable IfcRectangleProfileDefs

This commit is contained in:
Yorik van Havre
2018-11-28 18:27:12 -02:00
parent 03e7083dd5
commit 0939f17d6a
2 changed files with 18 additions and 0 deletions

View File

@@ -485,6 +485,22 @@
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_16">
<property name="toolTip">
<string>When possible, IFC objects that are extruded rectangles are exported as IfcRectangleProfileDef. However, some other applications notoriously have problems importing that entity. If this is your case, you can disable this here (all profiles will be exported as IfcArbitraryClosedProfileDef).</string>
</property>
<property name="text">
<string>Disable IfcRectangleProfileDef</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>DisableIfcRectangleProfileDef</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -2525,6 +2525,8 @@ def checkRectangle(edges):
""" checkRectangle(edges=[]): This function checks whether the given form rectangle
or not. It will return True when edges form rectangular shape or return False
when edges not form a rectangular."""
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("DisableIfcRectangleProfileDef",False):
return False
if len(edges) != 4:
return False
angles = [round(getEdgesAngle(edges[0], edges[1])), round(getEdgesAngle(edges[0], edges[2])),