GetElevation Example

Land Auto

GetElevation Example

Sub Example_GetElevation()
    
    ' This example returns the Elevation for an entered point for the first
    ' surface in the collection.
    Dim surfs As AeccSurfaces
    Dim surf As AeccSurface
    Set surfs = AeccApplication.ActiveProject.Surfaces
    Set surf = surfs.Item(0)
    Dim returnPnt As Variant
    Dim elev As Double
    
    ' Get a point
    returnPnt = ThisDrawing.Utility.GetPoint(, "Select a point: ")
    
    ' Get the elevation from the selected point
    elev = surf.GetElevation(returnPnt(0), returnPnt(1))
    
    MsgBox "The elevation from GetElevation is " & elev, vbInformation, "GetElevation Example"
    
End Sub