Skip To Content

Attributes.Delete (.NET)

The Attributes.Delete method deletes the ArcGIS for AutoCAD attribute values and XRECORD values from the specified entity, which causes the feature to assume all default values. If you include a fieldList parameter value, only those specified fields attribute values are deleted.

Declaration

public bool Esri.ArcGISForAutoCAD.Attributes.Delete(Document doc, ObjectId objId, List<string> fieldList = null)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

ObjectId

objId

The AutoCAD object ID of the feature.

required

List<string>

fieldList

A list of field names as individual strings.

optional

Returns

TypeDescription

bool

true if the attributes were deleted successfully

Remarks on error conditions

This method can throw an exception or may return false or null if a parameter is invalid.

Example

Print the success of deleting the value of the Pavement field from the selected entity. The field remains a part of the feature layer.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var objectId = Esri.ArcGISForAutoCAD.FeatureLayer.SelectEntity(doc, "Centerlines");
var fieldList = new List<string> { "Pavement" };

// Delete the attribute value from the designated field
var success = Esri.ArcGISForAutoCAD.Attributes.Delete(doc, objectId, fieldList);

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

/* Example output 
True
*/

See also

FeatureLayer.SelectEntity—This .NET method prompts the selection of one entity and returns its AutoCAD ObjectId value.

esri_attributes_delete—An AutoLISP function that deletes the ArcGIS for AutoCAD attribute values and XRECORD values from the specified entity.