The Domain.Get method returns the properties of a named field domain as a dictionary. These properties include domain Name, Type, and Field Type. A collection of domain names defined in the drawing can be obtained using Domain.Names. The allowable values defined in a field domain can be obtained using Domain.Values.
Declaration
public Dictionary<string, string> Esri.ArcGISForAutoCAD.Domain.Get(Document doc, string domainName)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
string | domainName | An existing field domain name in the drawing. | required |
Returns
| Type | Description |
|---|---|
Dictionary<string, string> | A dictionary of field domain properties for the specified domain. Key: Name, Type, or Field Type, Value: Respective property value. |
Remarks on error conditions
This method may throw an exception or return null if a parameter is invalid.
Example
Print the properties of the Height field domain defined in the drawing.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Get the domain properties
var domainProperties = Esri.ArcGISForAutoCAD.Domain.Get(doc, "Height");
// Print the domain properties
foreach (var property in domainProperties)
{
doc.Editor.WriteMessage("\n{0}: {1}", property.Key, property.Value);
}
/* Example output
Name: Height
Type: CodedValue
Field Type: Text
*/
See also
Domain.Names—A .NET method that returns the names of field domains defined in the drawing as a collection of strings.
Domain.Values—A .NET method that gets the values associated with a named field domain as a dictionary.
esri_domain_get—An AutoLISP function that returns the properties of a named field domain as an associated list.