Hi. I've been doing some non-computer things over the past couple of weeks, and consequently there haven't been as many updates to PythonCAD as I would have liked. Also, a file-loading issue that has been brought to my attention had pointed out a flaw in the current code that will change numerous routines. The problem arose when a file with two points at the same coordinates was being loaded. The first of the two points is created and added to the drawing without problem, but things go blam when the second point is handled. What happens is the current code for the addObject() method and friends in the Layer class is written so that identical entities are not added into the Layer, and furthermore the code does not indicate that the entity was not added. The issue of silently not adding the object is an API flaw that needs fixing. As for the Layer not adding equivalent entities, that was a design decision that was managable in earlier PythonCAD releases but has now outlived its usefulness. The interactive creation of entities can be coded to always check if an existing entity is found where a new one would be added and either use the existing entity or not, but for non-interactive entity creation via a user-coded script then the testing for existing entities depends on how the code written in the script, something I can't control. Also, the modification of existing entities in a drawing could be performed so that entities having initially different coordinates/endpoints end up having common coordintes/endpoints.
The entity test, btw, is probably most useful for Point entities, as I think it is dumb to have lots of duplicated entities having the same values. For things like lines and circular shapes, again it seems dumb to have numerous entities with common endpoints like Segments or Polylines, or Circles/Arcs having identical center points and radius values. In two weeks I will again be away from my computer for a while, but between now and then I hope to have made many of the changes I think will be needed to handle fixing the file load issues as well as the initial impact these changes will produce. 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 _______________________________________________ PythonCAD mailing list [email protected] http://mail.python.org/mailman/listinfo/pythoncad
