(defun c:culen ()
(vl-load-com)
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 1))
;(setq diam (ah:butts but "h" ( list "choose size" "1/4" "3/8" "1/2" "3/4" "1" "1 1/4" "1 1/2" "2" "3" "4" "5"))) ; horizontal
(setq diam (ah:butts but "v" ( list "choose size" "1/4" "3/8" "1/2" "3/4" "1" "1 1/4" "1 1/2" "2" "3" "4" "5"))) ; vertical
)
(defun C:LTLL (/ ss total); = Leader with Total Length of Lines
(while (setq pt1 (getpoint "Pick line or pline"))
(setq ss (ssget pt1 '((0 . "LINE,lwpolyline"))))
(setq len (vla-get-Length (vlax-ename->vla-object (ssname ss 0))))
(command "_.leader" pt1 (getpoint pt1) "" (rtos len 2 1) "" )
(setq ss nil)
)
(princ)
); defun
Here is a bit more.
Try this. You may need to refine it.
You'll need to run it in the drawing you posted so the correct textstyle and mleader styles are set.
but lwpolyline and arc are already in hand.Unfortunately it doesn't work for me with polylines or arcs and throws the following text on the command line: ; error: ActiveX Server returned the error: unknown name: "STARTPOINT"
Unfortunately it doesn't work for me with polylines or arcs and throws the following text on the command line: ; error: ActiveX Server returned the error: unknown name: "STARTPOINT"
I managed to round to 1 decimal place however the text I would like to be displayed with two digits after the length. I don't know if that could be possible?
Another important aspect that I had not mentioned is that when creating the mleader it creates the opening of text just where I select the line. I would like first to choose where to place the text; since it does not always go along the line.
I know, I haven't written that bit yet. Wednesday.
Again that is "in hand" and will be sorted on Wednesday.
and if so do you want this done automatically by the lisp and restored on exit?
Or do you mean you want the leader to start where you select the line entity?
Attached is complete lisp.
Let me know if there are any problems.
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 4)) ; user request
(ah:butts 1 "v" a_lst)
(setq idx (1- but))