Jump to content

Recommended Posts

Posted

Hi, I have Lee-Mac's Area Label lisp and I modified it to give lengths of the lines selected by simply replacing "areas"s in code with "length"s :D 

 

 However it doesn't work with open lines. I guess the reason for that the code was designed to retreive areas of the selected objects must be closed (of course). So I looked up in the code to delete that option but I was not able to find anything about objects being closed except:

(vlax-curve-isclosed x)

but it can not be about this since it is about a curve, right? So anyone can help me about it please?

 

 

 

Posted

A line can be considered as a curve without curvature if that makes sense. Vlax-curve functions work on lines, polylines, arc etc; they don't have to curves. I don't think it is possible to adapt the code to work with open polylines. It would be better to find a seperate lisp that just reports the length of open polylines. Try this simple lisp . There is no testing to exclude non line entities or infinite line entities. If you wish to expand on it, be my guest.

 

(defun c:LL ( / )
  (setq ent (car (entsel "\nSelect Line Entity : ")))
  (setq len (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)))
  (alert (strcat "Length is : " (rtos len 2 3)))
)  

 

Posted (edited)

An alternative is to look at object then retrieve the length using the correct variable value, then use a simple Cond 

 

ARC = arclength

Line,pline = length

Circle = circumference

 

vla-get-length

 

Also lee-mac totallength.lsp

Edited by BIGAL
  • 2 years later...
Posted

Do any of you have this modifed lisp that does the same thing that Lee-Mac's Area Label lisp does but with lenghts?

Posted

Watch this space doing something at moment. Length, Area and block count.

  • Like 1

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