Can someone help me with my lisp. It keeps getting buggy and I would love to have some of the options changed (like the dimstyle it uses and the layer it uses, etc..) or if you have one that's better please let me know.
; FROM THE DESK OF PAUL STANDING And Gary W. Patterson
; ARCDIM.LSP VS 1.0 MARCH 10 1995 Mod August 7 1996
; MEASURES THE LINEAR LENGTH OF ARCS AND DIMENSIONS THE ARC
;; Save and get information from user
(setq la (getvar "CLAYER") ;Save current layer
);setq
;;Create the layer dim
(command "_layer" "make" "dim" "" ;Make the layer
"_layer" "s" "dim" "" ;Set layer
"_layer" "c" "magenta" "" "") ;Set color to red
(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)
(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) pause "exit")
)
(prompt "\nThe Selected entity was not an arc ")
)
(setvar "clayer" "0")
(setvar "cmdecho" 1)
(setvar "blipmode" 0)
;;Reset the current layer
(command "_.LAYER" "_S" la "")
(princ)
)
(princ "\nType arcdim to envoke the command: ")
Let me know if you need any information.