ConvertProjection

 

The ConvertProjection method converts the projection of a document.

 

Syntax

object.ConvertProjection( pProjection, ApplyDatum )

 

Parameter

Type

Description

pProjection

Projection

required; Projection object

ApplyDatum

Boolean

optional; true to apply datum conversion

 

Remarks

In order to convert a map document's projection, it is necessary to make a copy of the current map document projection with the CopyDocProjection method. Make the desired changes to the copy of the projection, apply the new changes with the ConvertProjection method, and then delete the copy of the projection. NOTE: It is important to delete the copy of the projection created with CopyDocProjection when you are done with it. If the projection copy is not deleted, the MapViewer application process will run even after MapViewer and Scripter are closed.

 

Example

This example makes a copy of the existing projection converts the projection to Albers Equal Area Conic, and then converts the map document's projection.

 

'Makes a copy of the current plot projection and

'assign it to the variable "Proj"

 Set Proj = Plot.CopyDocProjection

 

'Change the projection type to Albers Equal Area Conic

 Proj.ProjectionType = mvProjAlbersEqualAreaConic

 

'Convert the current map document's projection  

'to the project assigned to the Proj variable

 Plot.ConvertProjection(Proj,False)

 

'Delete the Proj object

 Proj.Delete

 

Used by: PlotDocument object