length of a scroll arc using AutoLisp

length of a scroll arc using AutoLisp

mike2334
Enthusiast Enthusiast
675 Views
2 Replies
Message 1 of 3

length of a scroll arc using AutoLisp

mike2334
Enthusiast
Enthusiast

I have drawn the top of a impeller scroll for a cyclone using AutoLisp.  Now using AutoLisp I have to find the length of this scroll so I can make the side.   How can I get this length, I have use pedit to make it all one line but with entget I can't find the length?  Is there a way to use list in Autolisp and pull out the length?

Thanks Mike

Michael Fyfe
0 Likes
676 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

post this in the Lisp Forum for better help. You should do a search first there in case there is something already written.

0 Likes
Message 3 of 3

dlanorh
Advisor
Advisor

If you are using a full windows version of AutoCAD, try this

 

(vl-load-com)
;My Scroll Length
(defun c:msl ( / ent elst typ len)

  (setq elst (entget (setq ent (car (entsel "\nSelect Line Entity : "))))
        typ (cdr (assoc 0 elst))
  );end_setq

  (cond ( (or (wcmatch typ "*POLYLINE")
              (vl-position typ (list "ARC" "CIRCLE" "ELLIPSE" "LINE" "SPLINE"))
          )
          (setq len (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)))
          (alert (strcat "Length : " (rtos len (getvar 'lunits) (getvar 'luprec))))
        )
        (t (alert "NOT a Line Entity or Infinite Length Entity"))
  );end_cond

  (princ)
);end_defun

 

I am not one of the robots you're looking for