Skip To Content

FeatureLayer.SublayerNames (.NET)

The FeatureLayer.SublayerNames method returns a collection of sublayer names of the specified web or document feature layer.

Declaration

public IEnumerable<string> Esri.ArcGISForAutoCAD.FeatureLayer.SublayerNames(Document doc, string flName)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing feature layer name in the drawing.

required

Returns

TypeDescription

IEnumerable<string>

A collection of sublayer names as strings.

Remarks on error conditions

This method may throw an exception or return null if a parameter is invalid, or the feature layer does not have sublayers.

Example

Print the sublayer names from the UtilityPoles feature layer.

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

// Get the sublayer names
var sublayerNames = Esri.ArcGISForAutoCAD.FeatureLayer.SublayerNames(doc, "UtilityPoles");

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

/* Example output
Steel
Wood
*/

See also

esri_sublayer_names—An AutoLISP function that returns a list of sublayer names of the specified web feature or document feature layer.