Use the ConvertCoordUnits method to convert user-specified coordinates
Syntax
object.ConvertCoordUnits( Vertices, SourceUnits, DestUnits )
Parameter |
Type |
Description |
Vertices |
Array of Doubles |
required; array of coordinates |
SourceUnits |
optional; source units; default: mvCoordDisplayUnitPageUnits |
|
DestUnits |
optional; destination units; default: mvCoordDisplayUnitPageUnits |
Example
'ConvertCoordUnits
'Create a base map layer of California and assign it to the variable "BaseMap"
Set BaseMap = Plot.CreateBaseMap(FileName:=mvApp.ModuleFolder + "\Samples\CA2010.gsb")
'Get the vertices of the boundary with PID "06071" into an array
BaseMap.Shapes.SelectByPID(PIDName:="06071")
Dim VertexArray() As Double
VertexArray() = BaseMap.Selection.Item(1).Vertices
'Print a coordinate pair to the debug window to show the original points
Debug.Print "X before: " ; VertexArray(0)
Debug.Print "Y before: " ; VertexArray(1)
'Convert the coordinates in the vertex array from lat/lon to meters
Plot.ConvertCoordUnits(VertexArray(), mvCoordDisplayUnitLatLon, mvCoordDisplayUnitMeters)
'Print a coordinate pair to the debug window to show the converted points
Debug.Print "X after: " ; VertexArray(0)
Debug.Print "Y after: " ; VertexArray(1)
Used by: PlotDocument object