Skip To Content

Domain.Values (.NET)

The Domain.Values method gets the values associated with a named field domain as a dictionary.

Declaration

public Dictionary<IConvertible, IComparable> Esri.ArcGISForAutoCAD.Domain.Values(Document doc, string domainName)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

domainName

An existing field domain name in the drawing.

required

Returns

TypeDescription

Dictionary<IConvertible, IComparable>

  • Range domain values are returned in a dictionary containing the minimum and maximum values as key value pairs. Key: Min or Max, Value: Min or max value.
  • Coded value domain values are returned in a dictionary containing key value pairs of the coded values and their coded value descriptions. The coded value will be of the same type as the field type. The coded value description will be a string. Key: Coded value, Value: Coded value description.

Remarks on error conditions

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

Example 1

Print the range domain values for a field controlled by the Diameter field domain.

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

// Get the domain values
var domainValues = Esri.ArcGISForAutoCAD.Domain.Values(doc, "Diameter");

// Print the domain values
foreach (var value in domainValues)
{
  doc.Editor.WriteMessage("\n" + value);
}

/* Example output 
[Min, 12]
[Max, 50]
*/

Example 2

Print the coded value domain values for a field controlled by the ShelterCode field domain.

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

// Get the domain values
var domainValues = Esri.ArcGISForAutoCAD.Domain.Values(doc, "ShelterCode");

// Print the domain values
foreach (var value in domainValues)
{
  doc.Editor.WriteMessage("\n" + value);
}

/* Example output 
[1, Open]
[2, Closed]
[3, Full]
[4, Alert]
[5, Standby]
[6, Unknown]
[0,  ]
*/

See also

Domain.Names—A .NET method that return the names of field domains defined in the drawing as a collection of strings.

esri_domain_values_get—An AutoLISP function that gets the values associated with a named field domain as an associated list.