I cant get it to function in AutoCAD 2004. I have zero knowledge of the lisp language so i am of no help. Here is the code: (defun c:tl (/ A B C D E tlength obslist mtest alength) (setq tlength 0) obslist ) (list "ARC" "CIRCLE" "ELLIPSE" "LINE" "POLYLINE" "SPLINE" "LWPOLYLINE") (prompt "\nSelect objects:") (setq a (ssget)) (setq b (sslength a)) (setq c 0) (while (<= 1 B) (setq D (ssname A C)) (setq mtest (member (cdr (assoc 0 (entget D))) obslist)) (if (= mtest nil) (prompt "\nThis object has no length definition.") (progn (command "lengthen" d "") (setq alength (getvar "perimeter") tlength (+ alength tlength) ) ) ) (setq B (- B 1) C (+ C 1) ) ) (prompt "\n============================") (prompt "\nTotal: ") (princ (rtos tlength 4 3)) (princ " = ") (princ (rtos tlength 2 3)) (princ " inches") (prin1) Any help would be greatly apperciated.
As an alternative try TLEN.LSP from http://www.turvill.com/t2/free_stuff ___ lisp language so i am of no help. Here is the code:
Modified (defun c:tl (/ A B C D E tlength obslist alength) (setq tlength 0) (prompt "\nSelect objects:") (setq a (ssget '((-4 . "<OR")(0 . "ARC")(0 . "CIRCLE")(0 . "ELLIPSE")(0 . "*LINE")(-4 . "OR>")))) (setq b (sslength a)) (setq c 0) (while (<= 1 B) (setq D (ssname A C)) (command "lengthen" d "") (setq alength (getvar "perimeter") tlength (+ alength tlength) B (- B 1) C (+ C 1)) ) (prompt "\n============================") (prompt "\nTotal: ") (princ (rtos tlength 4 3)) (princ " = ") (princ (rtos tlength 2 3)) (princ " inches") (prin1) ) cheers
Condense it (setq a (ssget '((0 . "ARC,CI*,EL*,LI*")))) -- AUTODESK Authorized Developer http://www.Cadentity.com MASi
Which would be a bad idea if you consider custom objects. -- R. Robert Bell Condense it (setq a (ssget '((0 . "ARC,CI*,EL*,LI*"))))
You had to throw a wrench in there, didn't you...? Then again it depends on whether they're using a custom object or bare autocad.
autocad. True. However, if you get files from outside the office, you have no idea what might be there.
It's good to have a good sense of humor... I thought I'd make you laugh... -- AUTODESK Authorized Developer http://www.Cadentity.com MASi