Skip To Content

FieldDefinition.Get (.NET)

The FieldDefinition.Get method gets the feature layer field properties for the specified field as a dictionary.

Declaration

public Dictionary<string, object> Esri.ArcGISForAutoCAD.FieldDefinition.Get(Document doc, string flName, string name, string sublayerName = null)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

Required

string

flName

An existing feature layer name in the drawing.

Required

string

name

The field name.

Required

string

sublayerName

The sublayer name. This parameter is necessary if you want to get appropriate field definitions for the target sublayer, which can differ from the parent feature layer.

Optional

Returns

TypeDescription

Dictionary<string, object>

A dictionary of field properties. The keys and values of the dictionary are described in the table below.

KeyTypeValue Description

"NAME"

string

The field name.

"TYPE"

string

The field type.

"READONLY"

bool

Specifies whether the field is read-only ( true = read-only).

"LENGTH"

int

The length of the field.X.

"VALUE"

IConvertible

The default value of the field definition, as the same type as the field type. If the field has a coded value domain, this is the index value, not the descriptive value.

"DOMAIN"

string

The name of the domain definition for the field.

Remarks on error conditions

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

Example

Print the field properties for the PoleType field of the Steel subtype of the UtilityPoles feature layer.

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

// Get the field definition properties
var fieldProperties = Esri.ArcGISForAutoCAD.FieldDefinition.Get(doc, "UtilityPoles", "PoleType", "Steel");

// Print the field definition properties
foreach (var property in fieldProperties)
{
  doc.Editor.WriteMessage("\n{0}: {1}", property.Key, property.Value);
}

/* Example output
NAME: PoleType
TYPE: Short
READONLY: False
LENGTH: -1
VALUE: 1
DOMAIN: UtilityPoles_TypeDomain
*/

See also

esri_fielddef_get—An AutoLISP function that gets the feature layer field properties of a feature layer as an associated list.