;|=============================================================|; ;| Dimset.lsp by Michael Bulatovich, 13th Feb., 2004 |; ;| www.michaelbulatovich.ca |: ;| |; ;| Sets the current DIMSTYLE by picking a dimension |; ;| or leader. |; ;| |; ;|=============================================================|; (defun c:dimset (/ cntr check newdim index newstring ) (setvar "cmdecho" 0) (setq newdim (cdr (assoc 3 (entget (car (entsel))) ) )) (setq cntr 1) (if cntr ;if the counter exists (progn (while cntr ;while the counter exists (setq check cntr) ;set check to counter (if (not (eq (substr newdim check 1) "$")) ;if the indexed character's not a $ (setq cntr (1+ cntr)) ;bump the counter (progn (setq index (- cntr 1)) (setq cntr nil) ) ;nil the counter to break the loop )))) (if index (progn (setq newstring (substr newdim 1 index));retrieve the substring to the $ (prompt (strcat "\n \n \n" newstring " is now the current DIMSTYLE.")) (command "dimstyle" "r" newstring) )) (graphscr) (princ) )