Skip To Content

FeatureLabel.Remove (.NET)

The FeatureLabel.Remove method removes the association between a feature and its text label.

Declaration

public bool Esri.ArcGISForAutoCAD.FeatureLabel.Remove(Document doc, string flName, string fieldName, ObjectId featureObjectId)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing feature layer name in the drawing.

required

string

fieldName

The feature layer field name associated with the label.

required

ObjectId

featureObjectId

The AutoCAD ObjectId of a feature to remove its label association.

required

Returns

TypeDescription

bool

true if the label association was removed successfully

Remarks on error conditions

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

Example

Print the success of removing the label association between the AutoCAD text entity and the Owner field on the selected feature from the Parcels feature layer.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var flName = "Parcels";
var fieldName = "Owner";
var featureObjId = Esri.ArcGISForAutoCAD.FeatureLayer.SelectEntity(doc, flName);

// Remove the label association
var success = Esri.ArcGISForAutoCAD.FeatureLabel.Remove(doc, flName, fieldName, featureObjId);

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

/* Example output 
True
*/

See also

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

esri_label_remove—An AutoLISP function that removes the association between a feature and its text label.