- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a lisp that will pop up display inches. My current units are set to decimal/unit-less. I would like the pop up display to also auto calculate and display feet next to the unit-less decimal aka inches in the same pop up display. This is the lisp I am currently working with. I'm sure it just needs a line or 2 added but not sure how to do it. LISP is the next thing on my list to learn for AutoCAD now that it is available on LT 2024, yay.
(defun C:TOTL ( / CurObj CurSet FltLst TmpLgt TotLgt)
(if (< (atof (getvar "ACADVER")) 15.0)
(alert " VxJoinLines requires AutoCAD 2000(i) or higher. ")
(progn
(vl-load-com)
(setq FltLst '((0 . "3DPOLY,ARC,CIRCLE,ELLIPSE,LINE,LWPOLYLINE,POLYLINE,SPLINE")
(-4 . "<NOT")
(-4 . "<OR")
(-4 . "&=") (70 . 16)
(-4 . "&=") (70 . 64)
(-4 . "OR>")
(-4 . "NOT>")
)
CurSet (cond ((ssget "I" FltLst)) ((ssget FltLst)))
TotLgt 0
)
(if CurSet
(progn
(while (setq CurEnt (ssname CurSet 0))
(setq CurObj (vlax-ename->vla-object CurEnt)
TmpLgt (vlax-curve-getDistAtParam CurObj
(vlax-curve-getEndParam CurObj)
)
TotLgt (+ TotLgt TmpLgt)
CurSet (ssdel CurEnt CurSet)
)
)
(alert (strcat "Total length of selected object(s) " (rtos TotLgt) " square inches."))
)
)
)
)
(princ)
)
Solved! Go to Solution.