Does anyone know where I can obtain a freeware lisp routine that lists the lengths of all the polylines on a specific layer or within a selection set? I want to avoid list if possible as there are rather a lot of polylines!
Does anyone know where I can obtain a freeware lisp routine that lists the lengths of all the polylines on a specific layer or within a selection set? ....
You can no doubt find many routines on the Discussion Group that will do something or other to all Polylines in a selection set, and perhaps to all those on a certain Layer. As for finding the lengths of them all, there are several approaches you can take:
(vl-load-com) if needed, then with the entity name saved in the 'path' variable....
(vlax-curve-getDistAtPoint path (vlax-curve-getEndPoint path)) returns 0 if it's closed, so you probably shouldn't use that [unless you would always be deailing only with open Polylines].
(vla-get-length (vlax-ename->vla-object path)) gives it for Lines and Polylines, so though it does NOT give it for Arcs or Circles or Ellipses or Splines, in this case it should be fine.
(vlax-curve-getDistAtParam path (vlax-curve-getEndParam path)) returns the length of any path type, open or closed, so it would also work, though it's longer than the previous one.
As to output, what do you mean by "lists the lengths"? Just displays them at the Command: prompt line, or saves them into a list as a variable so you can do something with them, or writes them to a file, or....?