Skip To Content

FeatureLayer.Get (.NET)

FeatureLayer.Get 方法用于返回要素图层属性的字典。

声明

public Dictionary<string, string> Esri.ArcGISForAutoCAD.FeatureLayer.Get(Document doc, string flName)

参数

类型名称描述必填

文档

doc

要进行操作的 AutoCAD 文档。

必填

string

flName

工程图中现有的要素图层名称。

必填

返回

类型描述

Dictionary<string, string>

要素图层属性的字典,其中可能包含以下内容:

  • Key:NAME,Value:要素图层的名称。
  • Key:GEOMTYPE,Value:要素图层几何类型(“面”、“折线”、“点”、“多面体”或“注记”)。
  • Key:TYPEFIELD,Value:如果要素图层具有子类型,则为该子类型所基于的字段的名称;否则,该名称将被忽略。
  • Key:FLTYPE, Value:文档或 web 要素图层类型。

错误条件备注

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

示例

打印 Buildings 要素图层的要素图层属性。

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

// Get the feature layer properties
var buildingsProperties = Esri.ArcGISForAutoCAD.FeatureLayer.Get(doc, "Buildings");

// Print the properties
foreach (var property in buildingsProperties)
{
  doc.Editor.WriteMessage("\nKey = {0}, Value = {1}", property.Key, property.Value);
}

/* Example output
Key = NAME, Value = Buildings
Key = GEOMTYPE, Value = Polygon
Key = TYPEFIELD, Value =
Key = FLTYPE, Value = Document
*/

另请参阅

esri_featurelayer_get - 此 AutoLISP 函数用于返回要素图层属性的关联列表。