Skip To Content

FeatureLayer.GetDefaultElementType (.NET)

The FeatureLayer.GetDefaultElementType returns default symbology and element settings information for a feature layer. This method returns a named tuple of element settings as follows:

  • The first value is the Type value, and the second value is the Description value.
  • The Type value is the AutoCAD or Civil 3D entity type used when new features are created in ArcGIS for AutoCAD. The valid values are Point, Block Reference, COGO Point, Hatch or Automatic.
  • The Description value is the AutoCAD block insert name when the element type is Block Reference.
  • The Description value is the point description prefix value when the element type is COGO Point.
  • The Description value is the hatch pattern name when the element type is Hatch.

Declaration

public (string Type, string Description) Esri.ArcGISForAutoCAD.FeatureLayer.GetDefaultElementType(Document doc, string flName, string sublayerName = null)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing point, multipoint or polygon feature layer in the drawing.

required

string

sublayerName

An existing feature layer sublayer name for the specified flName feature layer in the drawing.

optional

Returns

TypeDescription

(string Type, string Description)

A named tuple in which the first value is the Type value, and the second value is the Description value. The Type value is the Point, Block Reference, or COGO Point entity type. For polygon hatches the type value is Hatch or Automatic. Automatic omits any hatch fill symbol for polygons. The Description value is the block insert name, hatch pattern name, or COGO point description prefix.

Remarks on error conditions

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

Example

Print the element settings of a feature layer named Damage_to_Residential_Buildings.

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

// Get the element settings
var elementSettings = Esri.ArcGISForAutoCAD.FeatureLayer.GetDefaultElementType(doc, "Damage_to_Residential_Buildings");

// Print the element settings
doc.Editor.WriteMessage("Type: {0}, Description: {1}", elementSettings.Type, elementSettings.Description);

/* Example output
Type: Block Reference, Description: Damaged_Structure
*/

See also

FeatureLayer.SetDefaultElementType—A .NET method that sets the default element type of a feature layer and, if successful, returns those settings as a named tuple.

esri_featurelayer_getDefaultElementType—An AutoLISP function that returns an associated list of default element settings.