尝试以下Tannar:
- (defun c:stymcur ( / ent lst obj sty typ )
- (setq lst
- '(
- ("TEXT,MTEXT" . textstyle)
- ("MULTILEADER" . cmleaderstyle)
- ("ACAD_TABLE" . ctablestyle)
- )
- )
-
- (while
- (progn (setvar 'errno 0) (setq ent (car (entsel)))
- (cond
- ( (= 7 (getvar 'errno))
- (princ "\nMissed, try again.")
- )
- ( (null ent)
- nil
- )
- ( (not (vlax-property-available-p (setq obj (vlax-ename->vla-object ent)) 'stylename))
- (princ "\nObject does not have a style.")
- )
- ( (progn
- (setq typ (cdr (assoc 0 (entget ent)))
- sty (vla-get-stylename obj)
- )
- (vl-some '(lambda ( x ) (if (wcmatch typ (car x)) (setvar (cdr x) sty))) lst)
- )
- nil
- )
- ( (wcmatch typ "*DIMENSION") ;; they have to be awkward...
- (command "_.-dimstyle" "_R" sty)
- )
- ( (princ "\nThis program is not compatible with that object."))
- )
- )
- )
- (princ)
- )
- (vl-load-com) (princ)
|