Skip To Content

FeatureLayer.Names (.NET)

The FeatureLayer.Names method retrieves a collection of strings of the names of the document feature layers and web feature layers in the drawing.

Declaration

public IEnumerable<string> Esri.ArcGISForAutoCAD.FeatureLayer.Names(Document doc)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

Returns

TypeDescription

IEnumerable<string>

A collection of feature layer names as strings.

Remarks on error conditions

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

Example

Print the web and document feature layer names in the drawing.

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

// Get the feature layer names
var flNames = Esri.ArcGISForAutoCAD.FeatureLayer.Names(doc);

// Print the feature layer names
foreach (var name in flNames)
{
  doc.Editor.WriteMessage("\n" + name);
}

/* Example output
Buildings
Contours
Parcels
Parks
Spot_Elevation
Streets
*/

See also

DocFeatureLayer.Names—A .NET method that retrieves a collection of strings of the names of the document feature layers in the drawing.

WebFeatureLayer.Names—A .NET method that retrieves a collection of strings of the names of the web feature layers in the drawing.

esri_featurelayer_names—An AutoLISP function that returns a list of strings of the names of the document feature layers and web feature layers in the drawing.