This routine is to print station & offset of selected alignment and print profile elevation of selected profile view.
I am new to vba and am not sure why the alignment portion works, but the profile portion does not.
Any help much appreciated!
Rob
Sub Sto()
Dim oSelected As AcadObject
Dim ptBase As Variant
'get the alignment
ThisDrawing.Utility.GetEntity oSelected, ptBase, vbNewLine & "Select an alignment or Profile View: "
If TypeOf oSelected Is AeccAlignment Then
Dim stn As Double
Dim offset As Double
' get the point of interest
ptBase = ThisDrawing.Utility.GetPoint(, "Specify Point: ")
oSelected.StationOffset ptBase(0), ptBase(1), stn, offset
' print out the values
'
ThisDrawing.Utility.Prompt ("Station: " & CStr(stn))
ThisDrawing.Utility.Prompt (", Offset: " & CStr(offset))
'End If
ElseIf TypeOf oEnt Is AeccProfileView Then
Dim oProf As AeccProfileView
Set oProf = oEnt
Dim sta As Double
Dim elev As Double
Dim pntBase As Variant
' get the point of interest
ptBase = ThisDrawing.Utility.GetPoint(, "Specify Point: ")
oProf.FindStationAndElevationAtXY pntBase(0), pntBase(1), sta, elev
Debug.Print "Station: " & sta & " ..... Elevation: " & elev
End If
End Sub