TextSize Example

Land Auto

TextSize Example

Sub Example_TextSize()
    
    ' This example returns the TextSize setting for the
    ' first CurveText object in a selection set
    
    On Error Resume Next
    
    ' Delete existing SelectionSet
    ThisDrawing.SelectionSets("SSet").Delete
    
    ' Create the selection set based on a point selection
    ' and filter for CurveText objects
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
    
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    
    gpCode(0) = 0
    dataValue(0) = "AEC_CURVETEXT"
    
    Dim groupCode As Variant
    Dim dataCode As Variant
    
    groupCode = gpCode
    dataCode = dataValue
    ssetObj.SelectOnScreen groupCode, dataCode
    
    Dim objCrvTxt As AeccCurveText
    Set objCrvTxt = ssetObj.Item(0)
    
    MsgBox "The setting for TextSize is: " & objCrvTxt.TextSize, vbInformation, "TextSize Example"
    
End Sub