MText オブジェクトの相対的な行間係数を指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: 倍精度浮動小数点数型
MText オブジェクトの相対的な行間係数。0.25~4 の値を入力します。
行間係数は、あるテキスト行の基準線と次のテキスト行の基準線との間の垂直距離です。行間係数は単一行間隔の倍数として設定されます。
行間隔は、LineSpacingStyle プロパティを使用して、指定した距離を「最低」値とするか、または「固定」の値とするかのどちらかに設定できます。
VBA:
Sub Example_LineSpacingFactor()
' This example creates an MText object in model space
' and then finds the LineSpacingFactor for the 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) = 10#: 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 LineSpacingFactor
Dim currFactor As Double
currFactor = MTextObj.LineSpacingFactor
MsgBox "The LineSpacingFactor for the MText object is: " & currFactor
' Change the LineSpacingFactor
MTextObj.LineSpacingFactor = 4
MsgBox "The LineSpacingFactor for the MText object is: " & MTextObj.LineSpacingFactor
' Reset the LineSpacingFactor
MTextObj.LineSpacingFactor = currFactor
MsgBox "The LineSpacingFactor for the MText object is: " & MTextObj.LineSpacingFactor
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_LineSpacingFactor()
;; This example creates an MText object in model space
;; and then finds the LineSpacingFactor for the object.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq corner (vlax-3d-point 0 10 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 LineSpacingFactor
(setq currFactor (vla-get-LineSpacingFactor MTextObj))
(alert (strcat "The LineSpacingFactor for the MText object is: " (rtos currFactor 2)))
;; Change the LineSpacingFactor
(vla-put-LineSpacingFactor MTextObj 0.7)
(alert (strcat "The LineSpacingFactor for the MText object is: " (rtos (vla-get-LineSpacingFactor MTextObj) 2)))
;; Reset the LineSpacingFactor
(vla-put-LineSpacingFactor MTextObj currFactor)
(alert (strcat "The LineSpacingFactor for the MText object is: " (rtos (vla-get-LineSpacingFactor MTextObj) 2)))
)