Give this a try. I did change some of the code and tried to comment what i changed. Let me know if it works as planned.
Code:
(DEFUN DIALOG ()
(setq dcl_id (load_dialog "styles.dcl"))
(if (not (new_dialog "styles" dcl_id)
)
(exit)
)
(action_tile
"no" ;if cancel button pressed
"(done_dialog 0)" ;close dialog, set flag 0
) ;action_tile
(action_tile
"yes" ;if O.K. pressed
"(done_dialog 1)" ;action tile, set flag 1
)
(setq ans (start_dialog)) ;start dialog
(unload_dialog dcl_id)
(if (= ans 1) ;if yes clicked then do the below
(progn
(scale)
(arrow)
(setq lay (getvar "clayer"))
(dlay)
(princ)
(command "._dimradius")
(setvar "clayer" lay)
)
)
(if (= ans 0) ;if no clicked do the below
(command "._dimradius")
)
(PRINC)
)
;starts the command
(defun c:rd (/)
(setvar "cmdecho" 0)
;;; (setq ruser
;;; (getstring
;;; "\nImport Standard Dimension Style [Yes/No] <No>:"
;;; )
;;; )
;;; (progn
;;; (rdansw)
;;; )
;;; )
(if (tblsearch "dimstyle" "DIM-ARW") ;if tblsearch finds the dimstyle DIM-ARW the do the below if not call the DIALOG
(progn
(scale)
(arrow)
(setq lay (getvar "clayer"))
(dlay)
(command "._dimradius")
(setvar "clayer" lay)
)
(DIALOG)
)
(setvar "cmdecho" 1)
(princ)
)
;Scale look up
(defun scale ()
(SETQ annoscale (getstring "\nWhat is the drawing scale <1\" = 20'-0\">:"))
(IF (= annoscale nil)
(setvar "cannoscale" "1\" = 20'-0\"")
)
(if (= annoscale "40")
(setvar "cannoscale" "1\" = 40'-0\"")
)
(if (= annoscale "30")
(setvar "cannoscale" "1\" = 30'-0\"")
)
(if (= annoscale "20")
(setvar "cannoscale" "1\" = 20'-0\"")
)
(if (= annoscale "100")
(setvar "cannoscale" "1\" = 100'-0\"")
)
(if (= annoscale "50")
(setvar "cannoscale" "1\" = 50'-0\"")
)
(if (= annoscale "60")
(setvar "cannoscale" "1\" = 60'-0\"")
)
(if (= annoscale "80")
(setvar "cannoscale" "1\" = 80'-0\"")
)
(if (or (= annoscale "1/4")
(= annoscale "48"))
(setvar "cannoscale" "1/4\" = 1'-0\"")
)
(if (or (= annoscale "1/8")
(= annoscale "96"))
(setvar "cannoscale" "1/8\" = 1'-0\"")
)
(if (= annoscale "3/16")
(setvar "cannoscale" "3/16\" = 1'-0\"")
)
(if (= annoscale "3/8")
(setvar "cannoscale" "3/8\" = 1'-0\"")
)
(if (or (= annoscale "1/2")
(= annoscale "24"))
(setvar "cannoscale" "1/2\" = 1'-0\"")
)
(if (= annoscale "3/4")
(setvar "cannoscale" "3/4\" = 1'-0\"")
)
(if (= annoscale "1")
(setvar "cannoscale" "1\" = 1'-0\"")
)
(if (= annoscale "12")
(setvar "cannoscale" "1'-0\" = 1'-0\"")
)
)
;Dimension Creation
(defun arrow ()
(if (tblsearch "dimstyle" "DIM-ARW")
(command "-dimstyle" "r" "DIM-ARW")
(progn
(if (tblsearch "style" "TEXT")
(setvar "dimtxsty" "TEXT")
(txtstyle)
)
(variables)
(setvar "DIMBLK" ".")
(setvar "DIMBLK1" ".")
(setvar "DIMBLK2" ".")
(setvar "DIMLDRBLK" ".")
(command "-dimstyle" "AN" "" "DIM-ARW" "R" "DIM-ARW")
)
)
)
;Text Style Creation
(defun txtstyle ()
(command "-STYLE" "TEXT" "ARCHQUIK.shx" "A" "Y" "Y" "1/8" "" "" "" "" "")
)
;Layer Lookup
(defun dlay ()
(if (null (tblsearch "LAYER" "L-ANNO-DIMS"))
(PROGN
(command "-LAYER" "m" "L-ANNO-DIMS"
"c" "21" "L-ANNO-DIMS"
"s" "L-ANNO-DIMS" ""
)
)
)
(IF (= (TBLSEARCH "LAYER" "L-ANNO-DIMS"))
(PROGN
(command "-LAYER" "S" "L-ANNO-DIMS" "")
)
)
)