LineSpacingFactor Example

Using Programming Languages other than 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

 

   Comments?