Vla-settextstyle
- 構文
- (vla-settextstyle vla-object rowTypes StyleName )
- 機能
- 指定した行タイプの文字高さを設定する。
- 引数
-
- vla-object … VLAオブジェクト(Table、TableStyle)
- rowTypes … 変更する行タイプ。AcRowType 列挙型(acDataRow、acHeaderRow、acTitleRow、acUnknownRow)
- StyleName … 指定した行タイプに使用するも文字スタイル名。
- 戻り値
- nil
- サンプル
(vl-load-com)
(defun c:Example_SetTextHeight()
;; 表スタイルと各種の値を作成するサンプル
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq dictionaries (vla-get-Dictionaries doc))
(setq dictObj (vla-Item dictionaries "acad_tablestyle"))
;; カスタム表スタイルをディクショナリに作成
(setq keyName "新スタイル"
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.21"))
(vla-SetRGB col 12 23 45)
(vla-SetBackgroundColor customObj (+ acDataRow acTitleRow) col)
(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 "表スタイル名 = " (vla-get-Name customObj)
"\nスタイルの概要 = " (vla-get-Description customObj)
"\n流れの方向 = " (itoa (vla-get-FlowDirection customObj))
"\n水平のセルマージン = " (rtos (vla-get-HorzCellMargin customObj) 2)
"\nビットフラグ = " (itoa (vla-get-BitFlags customObj))
"\nタイトル行の文字高 = " (rtos (vla-GetTextHeight customObj acTitleRow) 2)
"\nタイトル行の文字スタイル = " (vla-GetTextStyle customObj acTitleRow)
"\nタイトル行の水平下部グリッドの可視性 = " (if (= (vla-GetGridVisibility customObj acHorzBottom acTitleRow) :vlax-true) "True" "False")
"\nタイトル行の位置合わせ = " (itoa (vla-GetAlignment customObj acTitleRow))
"\nヘッダー抑制 = " (if (= (vla-get-HeaderSuppressed customObj) :vlax-true) "True" "False")
)
)
(vlax-release-object col)
)
関連事項
- vlax-get-acad-object
- vla-get-activedocument
- vla-addobject
- vla-put-name
- vla-put-description
- vla-put-flowdirection
- vla-put-horzcellmargin
- vla-put-bitflags
- vla-settextheight
- vla-settextstyle
- vla-setrgb
- vla-setbackgroundcolor
- vla-setgridvisibility
- vla-setalignment
- vla-setrgb
- vla-setgridcolor
- vla-get-name
- vla-get-description
- vla-get-flowdirection
- vla-get-horzcellmargin
- vla-get-bitflags
- vla-gettextheight
- vla-gettextstyle
- vla-getgridvisibility
- vla-getalignment
- vla-get-headersuppressed
- vlax-release-object