Try the following code :
;; Load all LineTypes in AutoCAD
;; Check for presence of DOT linetype
;; If present, change extension lines of all dimension objects to DOT
;;
(defun c:test (/ ltobj LTNM ENT FOUND N OBJ SS1 CNT)
(vl-load-com)
(defun _loadAllLinetypes (linFile)
;; Credit to ALANJT
;; Source : http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/load-line-types-with-lisp/td-p/4305876
(if (setq linFile (findfile linFile))
(progn (command "_.-linetype" "_l" "*" linFile)
(while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (command ""))
T
)
)
)
;; Load all linetypes
(_loadAllLinetypes "acad.lin")
(_loadAllLinetypes "acadiso.lin")
(setq found nil)
;;
;; Check availability of DOT linetype
(vlax-for ltobj (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))
(if (vlax-property-available-p ltobj 'Name nil)
(progn (setq LTNM (strcase (vlax-get-property ltobj 'Name)))
(if (equal LTNM "DOT")
(setq found T)
)
)
)
)
;;
;; If Found then Put Linetype as DOT to Ext Line of all dimensions
(if found
(progn (if (setq ss1 (ssget "_X" (list (cons 410 "MODEL") (cons 0 "*DIMENSION"))))
(progn (setq cnt 0)
(repeat (setq n (sslength ss1))
(setq ent (ssname ss1 (setq n (1- n))))
(setq obj (vlax-ename->vla-object ent))
(if (vlax-property-available-p obj 'extline1linetype nil)
;; This check is necessary because certain dimensions may not have this property
(progn (vla-put-extline2linetype obj "DOT")
(vla-put-extline1linetype obj "DOT")
(setq cnt (1+ cnt))
)
)
)
(princ (strcat "\nLinetype changed to DOT for "
(itoa cnt)
" dimensions out of total "
(itoa (sslength ss1))
" dimensions."
)
)
)
(progn (princ "\nNo dimension objects found."))
)
)
(progn (princ "\nCound not find DOT linetype."))
)
(princ)
)