ScaleFactor property example

Sub ScaleFactor_Example()
' This example creates text and adds it to the drawing using the
' AddText method. It then obtains and resets the ScaleFactor property.
    Dim sText As String: sText = "Test string for ScaleFactor property"
    Dim insPt(0 To 2) As Double: insPt(0) = 0: insPt(1) = 9
    Dim dHeight As Double: dHeight = 5
    Dim textObj As AcadText
    Set textObj = ThisDrawing.ModelSpace.AddText(sText, insPt, dHeight)
    textObj.Update
    ThisDrawing.Application.ZoomExtents
    MsgBox "The ScaleFactor is " & textObj.ScaleFactor
    Dim dNewScaleFac As Double
    dNewScaleFac = InputBox("Enter a new scale factor:")
    textObj.ScaleFactor = dNewScaleFac
    textObj.Update
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.