From 6dd35078a246f2e001ef526bca5701b76446ab6e Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 5 Aug 2014 18:28:26 -0300 Subject: [PATCH] Draft: issue message if an object cannot be moved or rotated - fixes #1642 --- src/Mod/Draft/Draft.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index e1c27c9fc..72c3e30a2 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1168,6 +1168,11 @@ def move(objectslist,vector,copy=False): if not isinstance(objectslist,list): objectslist = [objectslist] newobjlist = [] for obj in objectslist: + if hasattr(obj,"Placement"): + if obj.getEditorMode("Placement") == ["ReadOnly"]: + if not copy: + FreeCAD.Console.PrintError(obj.Name+" cannot be moved because its placement is readonly.") + continue if getType(obj) == "Point": v = Vector(obj.X,obj.Y,obj.Z) v = v.add(vector) @@ -1266,6 +1271,11 @@ def rotate(objectslist,angle,center=Vector(0,0,0),axis=Vector(0,0,1),copy=False) if not isinstance(objectslist,list): objectslist = [objectslist] newobjlist = [] for obj in objectslist: + if hasattr(obj,"Placement"): + if obj.getEditorMode("Placement") == ["ReadOnly"]: + if not copy: + FreeCAD.Console.PrintError(obj.Name+" cannot be rotated because its placement is readonly.") + continue if copy: newobj = makeCopy(obj) else: