Vla-getbackgroundcolornone
- 構文
- (vla-getbackgroundcolornone vla-object rowTypes)
- 機能
- 指定した行タイプに背景色が適用されているかの値を返す。
- 引数
-
- vla-object … vla-object(Table、TableStyle)
- rowTypes … 変更する行タイプ。(AcRowType 列挙型)
- acDataRow
- acHeaderRow
- acTitleRow
- acUnknownRow
- 戻り値
- ブール型
- vlax-True: 背景色は行タイプに適用されている。
- vlax-False: 背景色は行タイプに適用されていない。
- サンプル
(vl-load-com)
(defun c:Example_SetColor()
;; 表スタイルを作成して各種の色をセットするサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq dictionaries (vla-get-Dictionaries doc))
(setq dictObj (vla-Item dictionaries "acad_tablestyle"))
;; 現在の表スタイルを取得
(setq tableStyle (vla-Item dictObj (vla-GetVariable doc "CTABLESTYLE")))
(setq colCurrent (vla-GetBackgroundColor tableStyle (+ acDataRow acTitleRow)))
(setq colRowCurrent (vla-GetColor tableStyle acDataRow))
(setq colNoneCurrent (vla-GetBackgroundColorNone tableStyle acHeaderRow))
(alert (strcat "表の色 \n"
"背景の ACI 値 = " (itoa (vla-get-ColorIndex colCurrent)) "\n"
"行の文字 ACI 値 = " (itoa (vla-get-ColorIndex colRowCurrent)) "\n"
"背景なし = " (if (= colNoneCurrent :vlax-true) "True" "False")))
(setq col (vlax-create-object "AutoCAD.AcCmColor.20"))
(vla-SetRGB col 0 0 255)
(vla-SetBackgroundColor tableStyle acTitleRow col)
(vla-SetRGB col 255 0 0)
(vla-SetColor tableStyle acDataRow col)
(vla-SetBackgroundColorNone tableStyle acHeaderRow (if (= colNoneCurrent :vlax-true) :vlax-false :vlax-true))
(setq colNew (vla-GetBackgroundColor tableStyle acTitleRow))
(setq colRowNew (vla-GetColor tableStyle acDataRow))
(setq colNoneNew (vla-GetBackgroundColorNone tableStyle acHeaderRow))
(alert (strcat "表の色 \n"
"背景の ACI 値 = " (itoa (vla-get-ColorIndex colNew)) "\n"
"行の文字 ACI 値 = " (itoa (vla-get-ColorIndex colRowNew)) "\n"
"背景なし = " (if (= colNoneNew :vlax-true) "True" "False")))
(vla-SetBackgroundColor tableStyle acTitleRow colCurrent)
(vla-SetColor tableStyle acDataRow colRowCurrent)
(vla-SetBackgroundColorNone tableStyle acHeaderRow colNoneCurrent)
(alert "表スタイルの値をリセット。")
(vlax-release-object col)
)
関連事項