Vla-setgridcolor
- 構文
- (vla-setgridcolor vla-object gridLineTypes rowTypes pColor)
- 機能
- 指定した罫線の線種と行タイプの罫線色の値を設定する。
- 引数
-
- vla-object … VLAオブジェクト(Table、TableStyle)
- gridLineTypes … 変更する罫線の線種。 AcGridLineType 列挙型
- acHorzBottom
- acHorzInside
- acHorzTop
- acInvalidGridLine
- acVertInside
- acVertLeft
- acVertRight
- rowTypes … 変更する行タイプ。AcRowType 列挙型
- acDataRow
- acHeaderRow
- acTitleRow
- acUnknownRow
- pColor … 罫線に割り当てる AutoCAD True Color オブジェクト。(AcCmColor)
- 戻り値
- nil
- サンプル
(vl-load-com) (defun c:Example_SetGridColor() ;; テーブルスタイルを作成して属性値をいろいろ変えるサンプル (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 keyName "NewStyle" className "AcDbTableStyle") (setq customObj (vla-AddObject dictObj keyName className)) (vla-put-Name customObj "NewStyle") (vla-put-Description customObj "New Style for My Tables") (vla-put-FlowDirection customObj acTableBottomToTop) (vla-put-HorzCellMargin customObj 0.22) (vla-put-BitFlags customObj 1) (vla-SetTextHeight customObj (+ acDataRow acTitleRow) 1.3) (vla-SetTextStyle customObj (+ acDataRow acTitleRow) "Standard") (setq col (vlax-create-object "AutoCAD.AcCmColor.20")) ; バージョンに合わせて変える (vla-SetRGB col 12 23 45) (vla-SetBackgroundColor customObj (+ acDataRow acTitleRow) col) (vla-SetBackgroundColorNone customObj acHeaderRow :vlax-false) (vla-SetGridVisibility customObj (+ acHorzInside acHorzTop) (+ acDataRow acTitleRow) :vlax-true) (vla-SetAlignment customObj (+ acDataRow acTitleRow) acBottomRight) (vla-SetRGB col 244 0 0) (vla-SetGridColor customObj (+ acHorzTop acHorzInside) acDataRow col) (alert (strcat "Table Style Name = " (vla-get-Name customObj) "\nStyle Description = " (vla-get-Description customObj) "\nFlow Direction = " (itoa (vla-get-FlowDirection customObj)) "\nHorzontal Cell Margin = " (rtos (vla-get-HorzCellMargin customObj) 2) "\nBit Flags = " (itoa (vla-get-BitFlags customObj)) "\nTitle Row Text Height = " (rtos (vla-GetTextHeight customObj acTitleRow) 2) "\nTitle Row Text Style = " (vla-GetTextStyle customObj acTitleRow) "\nGrid Visibility for HorizontalBottom TitleRow = " (if (= (vla-GetGridVisibility customObj acHorzBottom acTitleRow) :vlax-true) "True" "False") "\nTitle Row Alignment = " (itoa (vla-GetAlignment customObj acTitleRow)) "\nHeader Suppression = " (if (= (vla-get-HeaderSuppressed customObj) :vlax-true) "True" "False") ) ) (vlax-release-object col) )
関連事項