[PythonCAD] [PATCH] Fix for undo/redo operations on DimString entities

Art Haas ahaas at airmail.net
Tue Feb 7 23:06:44 CET 2006


Hi.

The small diff below fixes a problem I found when trying to undo
a color change on a DimString entity. I'm sending this out to
the list if people want to patch their copy of the latest release,
and those of you using Subversion can just run 'svn update' to
get this change as well. Sorry it didn't make it into the last
release.

Art

Index: PythonCAD/Generic/dimension.py
===================================================================
--- PythonCAD/Generic/dimension.py	(revision 2157)
+++ PythonCAD/Generic/dimension.py	(revision 2158)
@@ -194,6 +194,18 @@
         _data.setValue('print_decimal', self.__print_decimal)
         return _data
 
+    def getParent(self):
+        """Get the entity containing the DimString.
+
+getParent()
+
+This method overrides the Entity::getParent() call.
+        """
+        _parent = None
+        if self.__dim is not None:
+            _parent = self.__dim.getParent()
+        return _parent
+    
     def setLocation(self, x, y):
         """Set the location of the DimString.
 
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822


More information about the PythonCAD mailing list