I've got a lot of dwgs with wrong geometries in elevation/Z .
Some of them are 3Dpolys with one or more wrong z vertex (i.e.: z value = -500.000)
Attached an example of my problem.
I need to check , and possibly automatically correct, these errors putting verices/geometries to a default "0.5".
How can I do?
Thanks in advance!
Saby
@Anonymous wrote:
I've got a lot of dwgs with ... 3Dpolys with one or more wrong z vertex ....
I need to check , and possibly automatically correct, these errors ....
For the checking part, you can use (vlax-curve-isPlanar) and give it either the 3DPolyline's entity name or its conversion to a VLA object. That will return T if its vertices are all at the same elevation [and also if they're not, but they all lie in a common angled plane], or nil otherwise. You could step through a selection of them, and for any that are not planar, put them in a selection set or list, or change their Layer or color or linetype, or something, to identify them.
For the correcting part, that could be interesting, since a 3DPolyline doesn't have an elevation property, and doesn't define a coordinate system, as many other entity types do. For one that's parallel to the World Coordinate System, you could step through its vertices and look at their Z coordinates, find the value that occurs most often, and impose that on all that have a different value.
If 3wood's routine somehow doesn't do what you want, write back -- something like the above could be worked out easily enough, I think.
Thanks you for your kind answers, but...
3wood:
There is a function without dialogue box in CHZ20: (Chz20_cmd T)
Add it to a script file to excute it automatically. Refer to https://sites.google.com/site/cadkits/home/chz20 for more details.
I am sure it is not hard to find out some routines to run script file on multiple drawings. For example Lee Mac's Script Writer (http://www.lee-mac.com/scriptwriter.html) - I haven't try it by myself but I reckon you can trust the quality of his routines.
Can't find what you're looking for? Ask the community or share your knowledge.