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") FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" Role property to IfcRole\n")
if not "MoveWithHost" in pl: 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.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: if not "IfcProperties" in pl:
obj.addProperty("App::PropertyMap","IfcProperties","Component",QT_TRANSLATE_NOOP("App::Property","Stores IFC properties")) obj.addProperty("App::PropertyMap","IfcProperties","Component",QT_TRANSLATE_NOOP("App::Property","Stores IFC properties"))
if not "VerticalArea" in pl: 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 # don't set the length if we have a base object, otherwise the length X height calc
# gets wrong # gets wrong
obj.Length = p.GetFloat("StructureLength",100) 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" obj.IfcRole = "Column"
return obj return obj

View File

@@ -27,84 +27,68 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_5">
<item> <property name="text">
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_5"> <string>Auto-join walls</string>
<property name="text"> </property>
<string>Auto-join walls</string> <property name="checked">
</property> <bool>true</bool>
<property name="checked"> </property>
<bool>true</bool> <property name="prefEntry" stdset="0">
</property> <cstring>autoJoinWalls</cstring>
<property name="prefEntry" stdset="0"> </property>
<cstring>autoJoinWalls</cstring> <property name="prefPath" stdset="0">
</property> <cstring>Mod/Arch</cstring>
<property name="prefPath" stdset="0"> </property>
<cstring>Mod/Arch</cstring> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_8">
<item> <property name="toolTip">
<widget class="Gui::PrefCheckBox" name="gui::prefcheckbox_8"> <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 name="toolTip"> </property>
<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 name="text">
</property> <string>Join walls base sketches when possible</string>
<property name="text"> </property>
<string>Join walls base sketches when possible</string> <property name="prefEntry" stdset="0">
</property> <cstring>joinWallSketches</cstring>
<property name="prefEntry" stdset="0"> </property>
<cstring>joinWallSketches</cstring> <property name="prefPath" stdset="0">
</property> <cstring>Mod/Arch</cstring>
<property name="prefPath" stdset="0"> </property>
<cstring>Mod/Arch</cstring> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_11"> <widget class="Gui::PrefCheckBox" name="checkBox">
<item> <property name="toolTip">
<widget class="Gui::PrefCheckBox" name="checkBox"> <string>Two possible strategies to avoid circular dependencies: Create one more object (unchecked) or remove external geometry of base sketch (checked)</string>
<property name="toolTip"> </property>
<string>Two possible strategies to avoid circular dependencies: Create one more object (unchecked) or remove external geometry of base sketch (checked)</string> <property name="text">
</property> <string>Remove external geometry of base sketches when needed</string>
<property name="text"> </property>
<string>Remove external geometry of base sketches when needed</string> <property name="prefEntry" stdset="0">
</property> <cstring>archRemoveExternal</cstring>
<property name="prefEntry" stdset="0"> </property>
<cstring>archRemoveExternal</cstring> <property name="prefPath" stdset="0">
</property> <cstring>Mod/Arch</cstring>
<property name="prefPath" stdset="0"> </property>
<cstring>Mod/Arch</cstring> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <widget class="Gui::PrefCheckBox" name="checkBox_7">
<item> <property name="toolTip">
<widget class="Gui::PrefCheckBox" name="checkBox_7"> <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 name="toolTip"> </property>
<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 name="text">
</property> <string>Apply Draft construction style to subcomponents</string>
<property name="text"> </property>
<string>Apply Draft construction style to subcomponents</string> <property name="prefEntry" stdset="0">
</property> <cstring>applyconstructionStyle</cstring>
<property name="prefEntry" stdset="0"> </property>
<cstring>applyconstructionStyle</cstring> <property name="prefPath" stdset="0">
</property> <cstring>Mod/Arch</cstring>
<property name="prefPath" stdset="0"> </property>
<cstring>Mod/Arch</cstring> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_14"> <layout class="QHBoxLayout" name="horizontalLayout_14">
@@ -198,6 +182,22 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
</item> </item>