Arch: Added pref option to set default MoveWithHost property

This commit is contained in:
Yorik van Havre
2018-12-01 12:23:45 -02:00
parent 79ba082c55
commit 5217b245b4
3 changed files with 76 additions and 73 deletions

View File

@@ -257,6 +257,7 @@ class Component:
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" Role property to IfcRole\n")
if not "MoveWithHost" in pl:
obj.addProperty("App::PropertyBool","MoveWithHost","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved"))
obj.MoveWithHost = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveWithHost",False)
if not "IfcProperties" in pl:
obj.addProperty("App::PropertyMap","IfcProperties","Component",QT_TRANSLATE_NOOP("App::Property","Stores IFC properties"))
if not "VerticalArea" in pl:

View File

@@ -96,7 +96,9 @@ def makeStructure(baseobj=None,length=None,width=None,height=None,name="Structur
# don't set the length if we have a base object, otherwise the length X height calc
# gets wrong
obj.Length = p.GetFloat("StructureLength",100)
if obj.Height > obj.Length:
if not height and not length:
obj.IfcRole = "Undefined"
elif obj.Height > obj.Length:
obj.IfcRole = "Column"
return obj

View File

@@ -27,84 +27,68 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_5">
<property name="text">
<string>Auto-join walls</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>autoJoinWalls</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_5">
<property name="text">
<string>Auto-join walls</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>autoJoinWalls</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_8">
<property name="toolTip">
<string>If this is checked, when 2 similar walls are being connected, their underlying sketches will be joined into one, and the two walls will become one</string>
</property>
<property name="text">
<string>Join walls base sketches when possible</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>joinWallSketches</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_8">
<property name="toolTip">
<string>If this is checked, when 2 similar walls are being connected, their underlying sketches will be joined into one, and the two walls will become one</string>
</property>
<property name="text">
<string>Join walls base sketches when possible</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>joinWallSketches</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="toolTip">
<string>Two possible strategies to avoid circular dependencies: Create one more object (unchecked) or remove external geometry of base sketch (checked)</string>
</property>
<property name="text">
<string>Remove external geometry of base sketches when needed</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>archRemoveExternal</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="toolTip">
<string>Two possible strategies to avoid circular dependencies: Create one more object (unchecked) or remove external geometry of base sketch (checked)</string>
</property>
<property name="text">
<string>Remove external geometry of base sketches when needed</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>archRemoveExternal</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_7">
<property name="toolTip">
<string>If this is checked, when an object becomes Subtraction or Addition of an Arch object, it will receive the Draft Construction color.</string>
</property>
<property name="text">
<string>Apply Draft construction style to subcomponents</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>applyconstructionStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="Gui::PrefCheckBox" name="checkBox_7">
<property name="toolTip">
<string>If this is checked, when an object becomes Subtraction or Addition of an Arch object, it will receive the Draft Construction color.</string>
</property>
<property name="text">
<string>Apply Draft construction style to subcomponents</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>applyconstructionStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
@@ -198,6 +182,22 @@
</item>
</layout>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="checkBox_4">
<property name="toolTip">
<string>By default, new objects will have their &quot;Move with host&quot; property set to False, which means they won't move when their host object is moved.</string>
</property>
<property name="text">
<string>Set &quot;Move with host&quot; property to True by default</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>MoveWithHost</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>