 - (defun c:tt1 (/ OBJNAME ATTS)
- (vlax-for blkobj (vla-get-blocks
- (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- (vlax-for obj blkobj
- (if (or (= "AcDbMText" (setq objname (vla-get-objectname obj)))
- (= "AcDbText" objname)
- (= "AcDbAttribute" objname)
- (= "AcDbAttributeDefinition" objname)
- )
- (VL-CATCH-ALL-APPLY 'vla-put-stylename (list obj "宋体"))
- )
- (if (and
- (or (= "AcDbMInsertBlock" objname)
- (= "AcDbBlockReference" objname)
- )
- (setq atts (vlax-invoke obj 'GetAttributes))
- )
- (foreach a atts (VL-CATCH-ALL-APPLY 'vla-put-stylename (list a "宋体")))
- )
- )
- )
- (setvar 'textstyle "宋体")
- (command "purge" "st" "*" "n")
- (princ)
- )
|