The DocFeatureLayer.Names method retrieves a collection of strings of the names of the document feature layers in the drawing.
Declaration
public IEnumerable<string> Esri.ArcGISForAutoCAD.DocFeatureLayer.Names(Document doc)
Parameter
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
Returns
| Type | Description |
|---|---|
IEnumerable<string> | A collection of document feature layer names as strings. |
Remarks on error conditions
This method may throw an exception or return an empty string or null if a parameter is invalid.
Example
Print the document feature layer names in the drawing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Get the document feature layer names
var dflNames = Esri.ArcGISForAutoCAD.DocFeatureLayer.Names(doc);
// Print the document feature layer names
foreach (var name in dflNames)
{
doc.Editor.WriteMessage("\n" + name);
}
/* Example output
Buildings
Contours
Parcels
Parks
Spot_Elevation
Streets
*/
See also
FeatureLayer.Names—A .NET method that retrieves a collection of strings of the names of the document feature layers and web features 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_docfeaturelayer_names—An AutoLISP function that returns a list of strings of the names of the document feature layers in the drawing.