Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am very basic when it comes to lisp routines. I know very little and don't really understand when I see code in messages.
I have a lisp that will add the length of lines with or without the bearings, which is great! I use it all the time. But it doesn't add the length of the arcs. So I'm looking for a lisp that will add the length in simple text form (xx.xx)
I've looked through many posts and found this (attached) but it didn't work. I'm hoping you guys, with all your wisdom, can help me.
(defun c:CA ( / ss acadModel precision ctr obj len rad ang txt txtObj)
(if (setq ss (ssget '((0 . "ARC"))))
(progn
(setq acadModel (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setq precision 2)
(setq ctr 0)
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss ctr)))
(setq len (rtos (vla-get-arcLength obj) 2 precision))
(setq rad (rtos (vla-get-radius obj) 2 precision))
(setq ang (rtos (cvunit (vla-get-totalAngle obj) "radians" "degrees") 2 precision))
(setq txt (strcat "L=" len " R=" rad " A=" ang))
(setq txtObj (vla-addtext acadModel txt (vla-get-center obj) 1))
(vla-put-alignment txtObj acAlignmentMiddleCenter)
(vla-put-textAlignmentPoint txtObj (vla-get-center obj))
);repeat
));if ss
(princ)
);defun
Solved! Go to Solution.