SampleElevation Example

Land Auto

SampleElevation Example

Sub Example_SampleElevation()
    
    ' This example returns an array of points between a selected start and end point
    ' for the first surface in the collection. The array from points includes the start
    ' and end points and all points that intersect an edge between the start and
    ' endpoint.
    Dim surf As AeccSurface
    Set surf = AeccApplication.ActiveProject.Surfaces.Item(0)
    
    Dim pnt1 As Variant
    Dim pnt2 As Variant
    Dim derivedPnts As Variant
    
    ' Return points using a prompt
    pnt1 = ThisDrawing.Utility.GetPoint(, "Select first point: ")
    pnt2 = ThisDrawing.Utility.GetPoint(pnt1, "Select second point: ")
    
    derivedPnts = surf.SampleElevations(pnt1, pnt2)
    
    MsgBox "The first two points in the derived points are:" & vbCrLf & _
        derivedPnts(0) & ", " & derivedPnts(1) & ", " & derivedPnts(2) & vbCrLf & _
        derivedPnts(3) & ", " & derivedPnts(4) & ", " & derivedPnts(5), vbInformation, _
        "SampleElevations Example"
    
End Sub