オブジェクトの幅を指定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.Width
タイプ: Application、DgnUnderlay、Document、DwfUnderlay、GeomapImage、MText、OLE、PdfUnderlay、PointCloud、PViewport、RasterImage、Table、TextStyle、Toolbar、View、Viewport、Wipeout
このプロパティが適用されるオブジェクト。
読み込み専用: いいえ(GeomapImage、RasterImage、および Toolbar オブジェクトを除く。これらのオブジェクトの場合は読み込み専用)
タイプ: 倍精度浮動小数点数型
指定のオブジェクトの幅。この値は負ではなく必ず正でなければなりません。
MText: 現在の単位の文字境界の幅を指定します。AutoCAD では、テキストは境界内に折り返されます。したがって、幅はテキストを収納するのに十分な正の数である必要があります。幅が足りないと、テキストが読みづらくなったり、場合によってはまったく見えなくなってしまいます。

OLE: OLE オブジェクトの幅は、フレームの X 軸方向の計測値です。
Table: 表の幅は、表の X 軸方向の計測値です。
TextStyle: 文字間隔を設定します。1.0 より小さい値を入力すると、文字間隔は小さくなります。1.0 より大きい値を入力すると、文字間隔は大きくなります。最大値は 100 です。
Viewport: ビューポートの幅は、ビューポート枠の X 軸方向の計測値です。
View: ビューの幅は、モデルの表示に使用するビューポート内の領域の X 軸方向の計測値です。
Raster: ラスター イメージの幅(ピクセル単位)。
VBA:
Sub Example_Width()
' This example creates an MText object in model space.
' It then changes the width of the MText object.
Dim MTextObj As AcadMText
Dim corner(0 To 2) As Double
Dim width As Double
Dim text As String
corner(0) = 0: corner(1) = 5: corner(2) = 0
width = 10
text = "This is the text String for the mtext Object"
' Creates the mtext Object
Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
ZoomAll
' Find the current width of the mtext object
width = MTextObj.width
MsgBox "The current width of the mtext object is " & MTextObj.width, , "Width Example"
' Change the width of the mtext object
MTextObj.width = width / 2
MTextObj.Update
MsgBox "The new width of the mtext object is " & MTextObj.width, , "Width Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Width()
;; This example creates an MText object in model space.
;; It then changes the width of the MText object.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq corner (vlax-3d-point 0 5 0)
width 10
text "This is the text String for the mtext Object")
;; Creates the mtext Object
(setq modelSpace (vla-get-ModelSpace doc))
(setq MTextObj (vla-AddMText modelSpace corner width text))
(vla-ZoomAll acadObj)
;; Find the current width of the mtext object
(setq width (vla-get-width MTextObj))
(alert (strcat "The current width of the mtext object is " (rtos width 2)))
;; Change the width of the mtext object
(vla-put-width MTextObj (/ width 2))
(vla-Update MTextObj)
(alert (strcat "The new width of the mtext object is " (rtos (vla-get-width MTextObj) 2)))
)