I have downloaded a routine for doing arc dimensions in acad 2002. it works for what we need it to do but i would like to add the text (ARC LENGTH) after the numeric value. Also i would like to retrieve the units settings and reset them back after the routine runs. below is the code:
Code:
;arcdim.lsp Arc Length (c)1998, Paul Standing
;MEASURES THE LINEAR LENGTH OF ARCS AND DIMENSIONS THE ARC TO THE
(defun dtr (x)
(* pi (/ x 180.00))
)
(defun rtd (y)
(/ (* 180 y) pi)
)
(defun right ()
(setq ang1 (angle ep cen)
ang2 (angle ep1 cen)
ang (- ang1 ang2)
arclen (abs(* rad ang))
)
)
(defun left ()
(setq ang (- a1 a2))
(setq arclen (abs(* rad ang)))
)
;_______________________________________________________________________
(defun C:arcdim (/ ang1 ang2 ang arclen rad pick_pt pick_ang
cen pick_pt extpt1 extpt2 extpt3 extpt4 ep a1 a2 ep1 e6 e7 ent4 temp_pt1
temp_pt2 temp_pt3 temp_pt4 e1 e2 e3 e4 text_ang th txt1 txt e5 ep1a epa
ep1a1 epa1 search type)
(setvar "cmdecho" 0)
(command "-units" "5" "32" "1" "2" "0" "n" "")
(setvar "blipmode" 0)
(setq cn (entsel "\nSelect arc to dimension: "))
(setq dn (car cn))
(setq aw (entget dn))
(setq type (cdr(assoc 0 aw)))
(if (= type "ARC")
(progn
(setq a1 (cdr (assoc 50 aw)))
(setq a2 (cdr (assoc 51 aw)))
(setq cen (cdr (assoc 10 aw))
rad (cdr (assoc 40 aw)))
(setq ep (polar cen (cdr (assoc 50 aw)) rad)
ep1 (polar cen (cdr (assoc 51 aw)) rad))
(if (< a1 a2) (left)
(right)
)
(prompt "\nEnter dimension location: ")
(command "dim" "angular" "" cen ep ep1 pause (rtos arclen) "" "exit")
)
(prompt "\nThe Selected entity was not an arc ")
)
(setvar "clayer" "0")
(setvar "cmdecho" 1)
;(setvar "blipmode" 1)
(princ)
)
(princ "\nType arcdim to envoke the command: ")