Skip To Content

CoordinateSystem.DatumTransformationRemove (.NET)

The CoordinateSystem.DatumTransformationRemove method removes a datum transformation from the current drawing. Datum transformations are unique between the from and to coordinate systems in a drawing. These unique datum transformation definitions are identified using the fromCS and toCS coordinate systems when adding and removing them. Use the CoordinateSystem.DatumTransformations method to get the datum transformations stored in the drawing.

Note:

Datum transformations cannot be removed when the drawing contains web feature layers.

Declaration

public bool Esri.ArcGISForAutoCAD.CoordinateSystem.DatumTransformationRemove(Document doc, string fromCS, string toCS)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

fromCS

The valid well-known coordinate system ID (WKID)or well-known text (WKT) of the Esri coordinate system as a string.

required

string

toCS

The valid WKID or WKT of the Esri coordinate system as a string.

required

Returns

TypeDescription

bool

true if the datum transformation was removed successfully

Remarks on error conditions

This method may throw an exception or return false or null if a parameter is invalid or web feature layers are present in the drawing.

Example

Print the success of removing the existing datum transformation from the current drawing between the specified from and to coordinate systems.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;

// Remove the datum transformation
var success = Esri.ArcGISForAutoCAD.CoordinateSystem.DatumTransformationRemove(doc, "2882", "3857");

// Print the success
doc.Editor.WriteMessage(success.ToString());

/* Example output 
True
*/

See also

CoordinateSystem.DatumTransformations—A .NET method that returns all the datum transformation definitions in the drawing as a collection of dictionaries.

esri_coordsys_DatumTransformations_remove—An AutoLISP function that removes a datum transformation from the current drawing.