When we launch the list command, the Area system variable holds the area value of the selected shape.
How to get the length value into an Autolisp program to use it?
@Gokr wrote:When we launch the list command, the Area system variable holds the area value of the selected shape.
How to get the length value into an Autolisp program to use it?
Some things give "lengths", but not what you would want in all circumstances [with "path" a variable containing the entity name]:
(vlax-curve-getDistAtPoint path (vlax-curve-getEndPoint path)) returns 0 if closed.
(vla-get-length (vlax-ename->vla-object path)) gives it for Lines and Polylines, but NOT Arcs or Circles.
So use this, which returns length for any path type, open or closed:
(vlax-curve-getDistAtParam path (vlax-curve-getEndParam path))
@Gokr wrote:When we launch the list command, the Area system variable holds the area value of the selected shape.
How to get the length value into an Autolisp program to use it?
To be a little more comparable to your question, you can also, after using the List command on a single Polyline or Spline or Ellipse, look at the Perimeter System Variable. But that doesn't work for Lines or Arcs or Circles.
You can use something like
(setq ent (entsel "\nSelect object : "))
to get the object
and somelike
(COMMAND "LENGTHEN" ent "")
to get the object lenght and pass to perimeter sistemvar
and some like
(setq perim (GETVAR "perimeter"))
to use the peimeter value...
Cheers
Henrique