Jump to content

Select pline, get lenght, then offset with that lenght


Jocker_Boy

Recommended Posts

Hi,

 

I want to select one pline, obtain the lenght then use this dimension to offset other pline.

 

Cheers,

 

Gonçalo

Link to comment
Share on other sites

(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.

Link to comment
Share on other sites

My normal one

 

(vla-get-length (vlax-ename->vla-object (car (entsel "pick object" ))))

 

Many thanks. It's perferct!!!

Link to comment
Share on other sites

.... 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 ).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...