Vla-setalignment

提供:GizmoLabs - だいたい CAD LISP なサイト
印刷用ページはサポート対象外です。表示エラーが発生する可能性があります。ブラウザーのブックマークを更新し、印刷にはブラウザーの印刷機能を使用してください。
構文
(vla-setalignment vla-object rowTypes cellAlignment )


機能
指定した行タイプのセル位置合わせを設定する。


引数
  • vla-object … Table、TableStyle の VLAオブジェクト
  • rowTypes … 変更する行タイプ。cRowType 列挙型
  • acDataRow
  • acHeaderRow
  • acTitleRow
  • acUnknownRow
  • cellAlignment … 行タイプに使用する位置合わせ。AcCellAlignment 列挙型
  • acBottomCenter: 文字を文字の下中心に位置合わせする。
  • acBottomLeft: 文字を文字の左下に位置合わせする。
  • acBottomRight: 文字を文字の右下に位置合わせする。
  • acMiddleCenter: 文字を文字の中央に位置合わせする。
  • acMiddleLeft: 文字を文字の左下に位置合わせする。
  • acMiddleRight: 文字を文字の右中央に位置合わせする。
  • acTopCenter: 文字を文字の上中心に位置合わせする。
  • acTopLeft: 文字を文字の左上に位置合わせする。
  • acTopRight: 文字を文字の右上に位置合わせする。


戻り値
nil


サンプル
(vl-load-com)
(defun c:Example_SetAlignment()
    ;; 表スタイイルを作成して各値をセットするサンプル
    (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 オブジェクトをディクショナリに追加
    (setq keyName "NewStyle"
          className "AcDbTableStyle")
  
    (setq customObj (vla-AddObject dictObj keyName className))
      
    (vla-put-Name customObj "NewStyle")
    (vla-put-Description customObj "新しいスタイル: 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-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)
)

関連事項