From 57b596e0fc7f828b8e6ccb40e92770ae6b7edd51 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 8 Feb 2019 20:14:40 +1100 Subject: [PATCH] Add a move base property that moves the base object instead of the object itself if true. This is useful because it is the default case for most architectural work. --- src/Mod/Arch/ArchComponent.py | 3 ++ src/Mod/Arch/Resources/ui/preferences-arch.ui | 30 ++++++++++++++++++- src/Mod/Draft/Draft.py | 2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 4f75711722..a953fc202d 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -261,6 +261,9 @@ class Component: if r in IfcRoles: obj.IfcRole = r FreeCAD.Console.PrintMessage("Downgrading "+obj.Label+" IfcType property to IfcRole\n") + if not "MoveBase" in pl: + obj.addProperty("App::PropertyBool","MoveBase","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if moving this object moves its base instead")) + obj.MoveBase = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveBase",False) 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) diff --git a/src/Mod/Arch/Resources/ui/preferences-arch.ui b/src/Mod/Arch/Resources/ui/preferences-arch.ui index ba6e397315..d258ea6498 100644 --- a/src/Mod/Arch/Resources/ui/preferences-arch.ui +++ b/src/Mod/Arch/Resources/ui/preferences-arch.ui @@ -17,7 +17,16 @@ 6 - + + 9 + + + 9 + + + 9 + + 9 @@ -190,6 +199,9 @@ Set "Move with host" property to True by default + + false + MoveWithHost @@ -198,6 +210,22 @@ + + + + Set "Move base" property to True by default + + + false + + + MoveBase + + + Mod/Arch + + + diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index e6eea7415c..9dc45c1db7 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1479,6 +1479,8 @@ def move(objectslist,vector,copy=False): newobjlist = [] newgroups = {} for obj in objectslist: + if hasattr(obj, "MoveBase") and obj.MoveBase: + obj = obj.Base if hasattr(obj,"Placement"): if obj.getEditorMode("Placement") == ["ReadOnly"]: if not copy: