@Anonymous wrote:
....
I am not running the code for 3 D Polyline. Nor is the polyline of zero length.
....
That Polyline does, however, have its first two vertices at the same location. When I use UCS and its OBject option, and select the Polyline somewhere not right at its start point, it can use that to align the UCS, and it aligns it differently depending on where I select it, so it's obviously using adjacent vertices to the selection point. But when it is given an entity name [as the PLD command does, or Last in manual operation], apparently it uses the first two vertices somehow [though they are not actually the basis of the UCS angle, which for all-line-segment Polylines seems to go from first to last vertices], and for whatever reason, it can't handle it if they're at the same location.
If I use PEDIT and its Edit Vertex option, and Straighten that Polyline from the first vertex to the third [the first "Next" move with the Straighten option doesn't go anywhere, because the second vertex is at the same location as the first], then PLD works.
If this is a recurring problem for you, I imagine the routine could probably be made to "select" each Polyline somehow, rather than use its entity name. EDIT: Or, it could be made to check whether the first two vertices are at the same location, and if so, remove the second one and then proceed with putting it on a Diet.
Kent Cooper, AIA