ContourStyle Example

Land Auto

ContourStyle Example

Sub Example_ContourStyle()
    
    ' This example displays the contour style for the selected contour.
    
    On Error Resume Next
    
    ' Delete existing SelectionSet
    ThisDrawing.SelectionSets("SSet").Delete
    
    ' Create the selection set based on a point selection
    ' and filter for Contour 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) = "AECC_CONTOUR"
    
    Dim groupCode As Variant
    Dim dataCode As Variant
    Dim returnPnt As Variant
    
    groupCode = gpCode
    dataCode = dataValue
    returnPnt = ThisDrawing.Utility.GetPoint(, "Select a contour line: ")
    ssetObj.SelectAtPoint returnPnt, groupCode, dataCode
    
    Dim objContour As AeccContour
    Set objContour = ssetObj.Item(0)
    
    MsgBox "The ContourStyle for the selected contour is: " & objContour.ContourStyle.Name, _
        vbInformation, "ContourStyle Example"
    
End Sub