Skip To Content

FeatureLayer.SetDefaultElementType (.NET)

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

Declaration

public (string Type, string Description) Esri.ArcGISForAutoCAD.FeatureLayer.SetDefaultElementType(Document doc, string flName, string type, string description, 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

type

The Point, Block Reference, or AECC_COGO_POINT entity type. For polygon hatches the type value is Hatch or Automatic. Automatic omits any hatch fill symbol for polygons.

required

string

description

The block name if the type is Block Reference, a description if the type is AECC_COGO_POINT, or hatch pattern name for polygons.

required

string

sublayerName

An existing sublayer name of 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, or Hatch or Automatic for polygons, and the Description value is the block reference name, COGO point description prefix, or hatch pattern name.

Remarks on error conditions

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

Example

Set the default element settings of a feature layer named Damage_to_Residential_Buildings to be an AutoCAD block reference named Damaged_Structure and print the updated default element settings.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var flName = "Damage_to_Residential_Buildings"; 

// Set the element settings
var elementSettings = Esri.ArcGISForAutoCAD.FeatureLayer.SetDefaultElementType(doc, flName, "Block Reference", "Damaged_Structure");

// 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.GetDefaultElementType—A .NET method that gets the default element type settings of a feature layer.

esri_featurelayer_setDefaultElementType—An AutoLISP function that sets the default element type of a feature layer.