Vla-get-textfontstyle
- 構文
- (vla-get-textfontstyle vla-object )
- 機能
- 新しい文字のフォント スタイルを取得する。
- 引数
-
- vla-object … PreferencesDisplay のVLAオブジェクト
- 戻り値
- acTextFontStyle 列挙型
- acFontRegular
- acFontItalic
- acFontBold
- acFontBoldItalic
- このプロパティの初期値は acFontRegular。
- サンプル
(vl-load-com)
(defun c:Example_TextFontStyle()
;; TextFontStyle を変更するサンプル。
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
;; 現在の TextFontStyle 値
(setq currTextFontStyle (vla-get-TextFontStyle (vla-get-Display preferences)))
(setq constant (cond
((= currTextFontStyle acFontRegular) "acFontRegular")
((= currTextFontStyle acFontItalic) "acFontItalic")
((= currTextFontStyle acFontBold) "acFontBold")
((= currTextFontStyle acFontBoldItalic) "acFontBoldItalic")
))
(alert (strcat "現在の TextFontStyle は " constant))
;; 変更
(vla-put-TextFontStyle (vla-get-Display preferences) acFontBoldItalic)
(setq newTextFontStyle (vla-get-TextFontStyle (vla-get-Display preferences)))
(setq newConstant (cond
((= newTextFontStyle acFontRegular) "acFontRegular")
((= newTextFontStyle acFontItalic) "acFontItalic")
((= newTextFontStyle acFontBold) "acFontBold")
((= newTextFontStyle acFontBoldItalic) "acFontBoldItalic")
))
(alert (strcat "新しい TextFontStyle は " newConstant))
;; Reset TextFontStyle to its original value
(vla-put-TextFontStyle (vla-get-Display preferences) currTextFontStyle)
(alert (strcat "TextFontStyle を次に戻しました " constant))
)
関連事項