Vla-getgridcolor
- 構文
- (vla-getgridcolor vla-object gridLineType rowType)
- 機能
- 罫線の線種と行タイプの罫線の色値を返す。
- 引数
-
- vla-object … VLAオブジェクト(Table、TableStyle)
- gridLineType … 罫線のタイプ。AcGridLineType 列挙型
- acHorzBottom : 流出方向に基づいた、最も上または最も下の水平の罫線。
- acHorzInside : 先頭行と最終行を除くすべての水平の罫線。
- acHorzTop : 流出方向に基づいた、最も上または最も下の水平の罫線。
- acInvalidGridLine : 無効な罫線。
- acVertInside : 最も左と最も右の罫線を除くすべての垂直の罫線。
- acVertLeft : 最も左側の罫線。
- acVertRight : 最も右側の罫線。
- rowType … 行タイプ。 AcRowType 列挙型
- acDataRow
- acHeaderRow
- acTitleRow
- acUnknownRow
- 戻り値
- 行タイプの内容に割り当てられている True Color オブジェクト。(AcCmColor)
- サンプル
(vl-load-com) (defun c:Example_GetGridColor() ;; テーブルスタイルを作成して属性を色々変えるサンプル (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")) ;; TableStyle object を取得 (setq tableStyle (vla-Item dictObj (vla-GetVariable doc "CTABLESTYLE"))) (setq colGridCurrent (vla-GetGridColor tableStyle acHorzBottom acTitleRow)) (setq lwGridCurrent (vla-GetGridLineWeight tableStyle acHorzBottom acTitleRow)) (setq visGridCurrent (vla-GetGridVisibility tableStyle acHorzTop acTitleRow)) (alert (strcat "Grid settings" "\nColor (Bottom) = " (itoa (vla-get-ColorIndex colGridCurrent)) "\nLineweight (Bottom) = " (itoa lwGridCurrent) "\nVisibility (Top) = " (if (= visGridCurrent :vlax-true) "True" "False"))) (setq col (vlax-create-object "AutoCAD.AcCmColor.20")) (vla-SetRGB col 0 0 255) (vla-SetGridColor tableStyle acHorzBottom acTitleRow col) (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow acLnWt025) (vla-SetGridVisibility tableStyle acHorzTop acTitleRow (if (= visGridCurrent :vlax-true) :vlax-false :vlax-true)) (setq colGridNew (vla-GetGridColor tableStyle acHorzBottom acTitleRow)) (setq lwGridNew (vla-GetGridLineWeight tableStyle acHorzBottom acTitleRow)) (setq visGridNew (vla-GetGridVisibility tableStyle acHorzTop acTitleRow)) (alert (strcat "Grid settings" "\nColor (Bottom) = " (itoa (vla-get-ColorIndex colGridNew)) "\nLineweight (Bottom) = " (itoa lwGridNew) "\nVisibility (Top) = " (if (= visGridNew :vlax-true) "True" "False"))) (vla-SetGridColor tableStyle acHorzBottom acTitleRow colGridCurrent) (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow lwGridCurrent) (vla-SetGridVisibility tableStyle acHorzTop acTitleRow visGridCurrent) (alert "設定値を元にもどしました") (vlax-release-object col) )
関連事項