[PythonCAD] Dimension changes in the repo

Art Haas ahaas at airmail.net
Fri Feb 10 23:29:02 CET 2006


Hi.

I've sent my changes this week to the repo. While working on the entity
transfer stuff I started to think about how the code for creating
Dimension entities was designed. The arguments needed to create a
dimension were points, circles, or arcs plus layer arguments. The code
would try to establish that the referenced point, circle, or arc existed
in the corresponding layer argument, and things worked well enough.
Thinking about this I realized that the layer argument is essentially
pointless now that the same info can be retrieved with a getParent()
call on the point, circle, or arc, so why require it? The layer is
only necessary during file save and reload operations, and a simple
test to ensure the getParent() call does not return None provides
a good test to ensure the dimension is "sane". I went in and changed
the various __init__() methods for the dimension and removed the layer
arguments, then adjusted the code to match up the fewer arguments, and
while doing this made a couple of other simplifications and cleanups
as well.

After playing with these changes for a bit, I decided they made sense
so I commited them to the repo, and have pushed the changes out for other
to examine. Do an 'svn update' and you'll get them, plus a few small bug
fixes as well. A few runs of 'pychecker' turned up some embarrasing
typos, and going over some of the older code I found a few other goofs
as well.

Art
-- 
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