The DocFeatureLayer.Rename method renames a document feature layer. If the new document feature layer name already exists, the specified name is used with an appended number in succession.
Declaration
public string Esri.ArcGISForAutoCAD.DocFeatureLayer.Rename(Document doc, string flName, string newFlName)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing document feature layer name in the drawing. | required |
string | newFlName | The new document feature layer name. | required |
Returns
| Type | Description |
|---|---|
string | The new document feature layer name. |
Remarks on error conditions
This method can throw an exception, and may return an empty string or null if a parameter is invalid.
Example
Rename the Streets document feature layer Roads, and print the new document feature layer name.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Rename the document feature layer
var dflRename = Esri.ArcGISForAutoCAD.DocFeatureLayer.Rename(doc, "Streets", "Roads");
// Print the document feature layer name
doc.Editor.WriteMessage(dflRename);
/* Example output
Roads
*/
See also
DocFeatureLayer.Copy—This method copies an existing document feature layer definition to the specified name or a unique name in the current drawing.
esri_docfeaturelayer_rename—An AutoLISP function that renames a document feature layer.