Updated in September 2013. It has come to the author’s attention that the routine fails if there are coincident vertices at the beginning of a polyline. The new file accounts for that possibility.
Kent Cooper, with help from others, put together a fairly complex LISP routine used for weeding vertices from polylines. Only the code is complex, however — using this routine is a breeze. Load the LISP file and start the command by entering PLD at the command line. The routine works by eliminating extra polyline vertices based on the distance and angle between them. Extra vertices on collinear segments are deleted regardless of distance, and you have the choice of whether or not to straighten arc segments. Note that this routine only works on "LWpolyline" entities. Cadalyst tips "WEED" and "WEED2" work on the older "heavy" polylines. Nice job with good comments, and credit is given to others who helped with this code. |