Make Styles Current
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im looking for a lisp that will make the styles of a selected object current. ive found this but it only works on dimensions. is there a way i can get it to work on leaders, multileaders, mtext, text, etc.
(defun C:matchstyle (/ Res Elist Ent flag Style)
(setq flag 1)
(while flag
(while (null(setq Res (entsel "\nSelect a dimension or leader: "))))
(setq Elist (entget (car Res)))
(if (member (cdr (assoc 0 Elist)) '("DIMENSION" "LEADER"))
(setq flag nil)
);if
);while
(setq Style (cdr (assoc 3 Elist)))
(setvar 'clayer (cdr (assoc 8 Elist)))
(if (wcmatch Style "*$*")
(setq Style (substr Style 1 (- (strlen Style) 2))))
(setvar "nomutt" 1) (setvar "cmdecho" 0)
(command "dimstyle" "r" Style)
(setvar "nomutt" 0) (setvar "cmdecho" 1)
(princ (strcat "\n" style " is now the current DIMENSION style."))
(princ)
)