Vla-put-name
- 構文
- (vla-put-name vla-object name )
- 機能
- オブジェクト名を指定する。
- 引数
-
- vla-object … VLAオブジェクト(Application、Block、BlockReference、Dictionary、DimStyle、Document、ExternalReference、GeomapImage、Group、Layer、Layout、Linetype、Material、MenuGroup、MInsertBlock、MLeaderStyle、ModelSpace、PaperSpace、PlotConfiguration、PointCloud、PointCloudEx、PopupMenu、RasterImage、RegisteredApplication、Section、SelectionSet、Shape、TableStyle、TextStyle、Toolbar、ToolbarItem、UCS、View、Viewport、Wipeout、XRecord)
- name … オブジェクトの名前。 読み込み専用: いいえ(Application、Document、MenuGroup、ModelSpace、PaperSpace、SelectionSet、TextStyle オブジェクトを除く)
- 戻り値
- nil
- MEMO :
- Application、Document : このプロパティはパスではなくファイル名のみを返す。
- ToolbarItem : この名前はツールチップ テキストとして使用される。
- MenuGroup : この名前は 32 文字までに制限され、空白や区切り記号を含むことができない。
- Raster : このプロパティは、パス情報を含まないこと以外は ImageFile プロパティと同じ。
- XRecord : オブジェクトのこのオブジェクトが含まれているディクショナリ内での名前。この名前はオブジェクトのクラス名を表さない。
- BlockRef : ブロック参照には、図面内の有効なブロック定義のみの名前を割り当てることができる。固有の名前をブロック参照に割り当てても、新しいブロック定義は自動的に作成されない。新しいブロック定義を作成するには、Add メソッドを使用して新しい Block オブジェクトを Blocks コレクションに追加する。
- サンプル
(vl-load-com)
(defun c:Example_name()
(vl-load-com)
(defun c:Example_BitFlags()
;; 表スタイルオブジェクトを作成し、スタイル名とか
;; その他の属性の値を設定するサンプル。
(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 "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-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")
"\nタイトルの省略 = " (if (= (vla-get-TitleSuppressed customObj) :vlax-true) "True" "False")
)
)
(vlax-release-object col)
)
)
関連事項