Vla-setbackgroundcolornone

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(vla-setbackgroundcolornone vla-object rowTypes bValue)


機能
指定した行タイプに背景色が適用されるかを指定する。


引数
  • vla-object … vla-object(Table、TableStyle)
  • rowTypes … 変更する行タイプ。(AcRowType 列挙型)
  • acDataRow
  • acHeaderRow
  • acTitleRow
  • acUnknownRow
  • bValue … 背景色の適用指定(ブール型)
  • 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)
)


関連事項