Skip To Content

Domain.Get (.NET)

Domain.Get 方法可将命名字段属性域的属性作为字典返回。 这些属性包含属性域 NameTypeField Type。 可以使用 Domain.Names 获取工程图中定义的属性域名称集合。 可以使用 Domain.Values 获取在字段属性域中定义的允许值。

声明

public Dictionary<string, string> Esri.ArcGISForAutoCAD.Domain.Get(Document doc, string domainName)

参数

类型名称描述必填

文档

doc

要进行操作的 AutoCAD 文档。

必填

string

domainName

工程图中的现有字段属性域名称。

必填

返回

类型描述

Dictionary<string, string>

指定属性域的字段域属性字典。 Key:名称、类型或字段类型,Value:相应的属性值。

错误条件备注

如果参数无效,则此方法可能会抛出异常或者返回 null

示例

打印工程图中定义的 Height 字段属性域的属性。

// 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
*/

另请参阅

Domain.Names - 此 .NET 方法可以字符串集合形式返回工程图中定义的字段属性域的名称。

Domain.Values - 此 .NET 方法可以字典形式获取与命名字段属性域关联的值。

esri_domain_get - 此 AutoLISP 函数可以关联列表形式返回命名字段属性域的属性。