The FeatureLayer.Remove method removes a feature layer definition from the drawing, or, in the case of a web feature layer, both the layer definition and its entities from the drawing. This method also ignores any edits for a specified web feature layer that have not been synchronized.
Declaration
public bool Esri.ArcGISForAutoCAD.FeatureLayer.Remove(Document doc, string flName)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | flName | An existing feature layer name in the drawing. | required |
Returns
| Type | Description |
|---|---|
bool | true if the feature layer was removed successfully |
Remarks on error conditions
This method can throw an exception or may return false or null if a parameter is invalid.
Example 1
Print the success of removing the Shelters web feature layer connection and entities from the current drawing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Remove the web feature layer
var success = Esri.ArcGISForAutoCAD.FeatureLayer.Remove(doc, "Shelters");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
Example 2
Print the success of removing the Streets document feature layer definition from the current drawing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Remove the document feature layer
var success = Esri.ArcGISForAutoCAD.FeatureLayer.Remove(doc, "Streets");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
See also
esri_featurelayer_remove—An AutoLISP function that removes a feature layer from the drawing.