Skip To Content

esri_coordsys_DatumTransformations_set (AutoLISP)

This function sets a datum transformation in the current drawing. If the datum transformation (from and to coordinate systems) already exists, it is overwritten. The function will return the datum transformation set.

Syntax

(esri_coordsys_DatumTransformations_set FromCS ToCS transformationStep_properties)

Arguments

  • FromCS | string | required | Valid WKID (well-known coordinate system identification number) or WKT of the Esri coordinate system as a string.
  • ToCS | string | required | Valid WKID (well-known coordinate system identification number) or WKT of the Esri coordinate system as a string.
  • transformationStep_properties | associated list | required | A list of transformation steps as associated lists of two dotted pair step properties as defined in the following table:

    Associated labelValue typeValue descriptionRequired or optional
    "Direction"

    string

    The direction of the step, which is either "Forward" or 'Reverse' in which the transformation step should be applied.

    required

    "Step"

    string

    The WKID or WKT of the transformation step.

    required

Usage

When creating a composite datum transformation the order of each step must be correct. For example 2 below, 108355 is the first step and 108282 is the second and final step. The direction must be provided in the form of a string "Forward" or "Reverse" and are not case sensitive.

ArcGIS for AutoCAD does not validate the provided transformation steps. If any portion of the set method is invalid or applied in the wrong order, ArcGIS for AutoCAD may draw layers incorrectly.

Note:

When creating well-known text (WKT) as an AutoLISP string argument, the string must contain the appropriate escape characters to include the necessary quotation marks within the text string. The following are examples:

Coordinate system:

"PROJCS[\"NAD_1983_HARN_StatePlane_Florida_West_FIPS_0902_Feet\",GEOGCS[\"GCS_North_American_1983_HARN\",DATUM[\"D_North_American_1983_HARN\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",656166.6666666665],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-82.0],PARAMETER[\"Scale_Factor\",0.9999411764705882],PARAMETER[\"Latitude_Of_Origin\",24.33333333333333],UNIT[\"Foot_US\",0.3048006096012192],AUTHORITY[\"EPSG\",2882]]"

Datum transformation

"GEOGTRAN[\"WGS_1984_(ITRF00)_To_NAD_1983\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],METHOD[\"Coordinate_Frame\"],PARAMETER[\"X_Axis_Translation\",0.9956],PARAMETER[\"Y_Axis_Translation\",-1.9013],PARAMETER[\"Z_Axis_Translation\",-0.5215],PARAMETER[\"X_Axis_Rotation\",0.025915],PARAMETER[\"Y_Axis_Rotation\",0.009426],PARAMETER[\"Z_Axis_Rotation\",0.011599],PARAMETER[\"Scale_Difference\",0.00062],OPERATIONACCURACY[0.1]]"

Example usage 1

Attempts to set a single step datum transformation in the current drawing between the from and to coordinate systems denoted by WKID. The list of steps includes a single datum transformation step which references a WKID and should be applied in the forward order.

(esri_coordsys_DatumTransformations_set 
  "2882" "3857" 
   (list 
     (list (cons "Direction" "Forward") (cons "Step" 1580))
   )  
)

Result example usage 1

Sets the single step datum transformation in the current drawing and returns the entire definition of the datum transformation as an associated list.

(("From" . "2882") ("To" . "3857") ("Transformation" ((("Direction" . "Forward") ("Step" . "1580")))))

Example usage 2

Attempts to set a composite datum transformation in the current drawing between the from and to coordinate systems denoted by WKID (Well Known Identification numbers). The datum transformation steps referenced by WKID string values are directed to be applied in reverse order.

(esri_coordsys_DatumTransformations_set 
  "6425" "3857" 
  (list 
    (list (cons "Direction" "Reverse") (cons "Step" 108355))
    (list (cons "Direction" "Reverse") (cons "Step" 108282))
  )
)

Result example usage 2

Sets the two-step composite datum transformation in the current drawing and returns the entire definition of the datum transformation as an associated list.

(("From" . "6425") ("To" . "3857") ("Transformation" ((("Direction" . "Reverse") ("Step" . "108355")) (("Direction" . "Reverse") ("Step" . "108282")))))

Return values

  • The datum transformation is set and the entire definition of the datum transformation is returned as an associated list.
  • If the function fails, a list with the first value of nil is returned followed by an associated list containing the key value "Error" and an associated error message as a string: (nil ("Error" . "<message>")).

Failed return values

A failed return value can occur for any of the following reasons:

  • (nil ("Error" . "Failed"))

    The WKID or WKT provided is invalid.

  • (nil ("Error" . "This document contains existing web feature layers. Datum transformations cannot be modified when web feature layers present."))

    Datum transformations cannot be set or modified when the drawing contains existing web feature layers.

  • (nil ("Error" . "Missing required argument."))

    One or more of the required arguments was not supplied.