Select pline, get lenght, then
Hi,I want to select one pline, obtain the lenght then use this dimension to offset other pline.
Cheers,
Gonçalo (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
The above code will return the total length of a line/curve/pline.
From there, you just plug in the value to the Offset command and go. Find the length of the object can be so:
(vla-get-length (vlax-ename->vla-object ent)) My normal one
(vla-get-length (vlax-ename->vla-object (car (entsel "pick object" ))))
Many thanks. It's perferct!!!
Not yet so.
Try to select any object that doesn't have any length property or just pin a point on the screen to find out the outcome of the codes.
Furthermore its not necessarily / recommended at all to convert any object to vla-object unless you are in need of that conversion and have no solution with AutoLISP vanilla ( DXF ). Tharwat you are correct sometimes you need to pick an object then check what it is and is that property then available and I think it was to do with this exact request for length. It was just a simple example where it was expected the user would pick a suitable object.
Agreed, but I just wanted to pay OP's attention to such important issues.
页:
[1]