Converting Coordinates

AutoCAD Map 3D AutoLISP

Up a level
Converting Coordinates
 
 

Converting point coordinates from one geo-referenced system to another.

Keep in mind that any Cartesian coordinate pair you select in a geo-referenced coordinate system corresponds to a point on the surface of the earth. This fact defines a relation between the coordinate pairs in one coordinate system and the coordinate pairs in any other, so long as the point in question actually exists in both systems. In other words, so long as the coordinate systems have a region of intersection, and the point in question is in it.

To convert the coordinates of a point from one geo-referenced coordinate system to another
  1. Define a "source" coordinate system with ade_projsetsrc.
  2. Define a "destination" coordinate system with ade_projsetdest.
  3. Pass a coordinate pair to ade_projptforward.
  4. The function assumes that the coordinate pair you pass to it is a point in the source system, and it returns the corresponding coordinate pair in the destination system. If there is no corresponding coordinate pair, it returns nil.

To convert in the other direction, use ade_projptbackward.

You can specify coordinate triplets, but if you do, the Z value is ignored.