The esri_coordsys_DatumTransformation_set function sets a datum transformation in the current drawing. If the datum transformation (the from and to coordinate systems) already exists, it is overwritten. The function will return the datum transformation set.
Syntax
(esri_coordsys_DatumTransformation_set FromCS ToCS transformationStep_properties)
Arguments
- FromCS | string | required | The valid well-known ID (WKID) or well-known text (WKT) of the Esri coordinate system as a string.
- ToCS | string | required | The valid well-known ID (WKID) or well-known text (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 label Value type Value description Required or optional "Direction" string
The direction of the step, either "Forward" or "Reverse", that 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. In Example usage 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", which are not case sensitive.
ArcGIS for AutoCAD does not validate the transformation steps provided. 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 WKT as an AutoLISP string argument, the string must contain the appropriate escape characters to include the necessary quotation marks in 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
Set a single step datum transformation in the current drawing between the from and to coordinate systems denoted by a WKID. The list of steps includes a single datum transformation step that references a WKID and should be applied in the forward order.(esri_coordsys_DatumTransformation_set
"2882" "3857"
(list
(list (cons "Direction" "Forward") (cons "Step" 1580))
)
)
Result example usage 1
The single step datum transformation is set in the current drawing and the entire definition of the datum transformation is returned as an associated list.
(("From" . "2882") ("To" . "3857") ("Transformation" ((("Direction" . "Forward") ("Step" . "1580")))))Example usage 2
Set a composite datum transformation in the current drawing between the from and to coordinate systems denoted by a WKID. The datum transformation steps referenced by the WKID string values are to be applied in reverse order.(esri_coordsys_DatumTransformation_set
"6425" "3857"
(list
(list (cons "Direction" "Reverse") (cons "Step" 108355))
(list (cons "Direction" "Reverse") (cons "Step" 108282))
)
)
Result example usage 2
The two-step composite datum transformation is set in the current drawing and the entire definition of the datum transformation is returned as an associated list.
(("From" . "6425") ("To" . "3857") ("Transformation" ((("Direction" . "Reverse") ("Step" . "108355")) (("Direction" . "Reverse") ("Step" . "108282")))))Return values
The following are the possible return values:
- If successful, the datum transformation is set, and the entire definition of the datum transformation is returned as an associated list.
- If failed, it returns a list with the first value of nil; then, an associated list is returned 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 provided.