FeatureLayer.GetDefaultElementType 将返回要素图层的默认符号系统和元素设置信息。 此方法用于返回元素设置的命名元组,如下所示:
- 第一个值为 Type 值,第二个值为 Description 值。
- Type 值是在 ArcGIS for AutoCAD 中创建新要素时使用的 AutoCAD 或 Civil 3D 实体类型。 有效值为 Point、Block Reference、COGO Point、Hatch 或 Automatic。
- 当元素类型为 Block Reference 时,Description 值为 AutoCAD 块插入名称。
- 当元素类型为 COGO Point 时,Description 值为点描述前缀值。
- 当元素类型为 Hatch 时,Description 值为影线模式名称。
声明
public (string Type, string Description) Esri.ArcGISForAutoCAD.FeatureLayer.GetDefaultElementType(Document doc, string flName, string sublayerName = null)
参数
| 类型 | 名称 | 描述 | 必填 |
|---|---|---|---|
文档 | doc | 要进行操作的 AutoCAD 文档。 | 必填 |
string | flName | 工程图中现有的点、多点或面要素图层。 | 必填 |
string | sublayerName | 工程图中指定 flName 要素图层的现有要素图层子图层名称。 | 可选 |
返回
| 类型 | 描述 |
|---|---|
(string Type, string Description) | 命名元组,其中第一个值为 Type 值,第二个值为 Description 值。 Type 值为 Point、Block Reference 或 COGO Point 实体类型。 对于面影线,类型值为 Hatch 或 Automatic。Automatic 将忽略面的任何影线填充符号。 Description 值为块插入名称、影线模式名称或 COGO 点描述前缀。 |
错误条件备注
如果参数无效,则此方法可能会抛出异常或者返回 null。
示例
打印名为 Damage_to_Residential_Buildings 的要素图层的元素设置。// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Get the element settings
var elementSettings = Esri.ArcGISForAutoCAD.FeatureLayer.GetDefaultElementType(doc, "Damage_to_Residential_Buildings");
// Print the element settings
doc.Editor.WriteMessage("Type: {0}, Description: {1}", elementSettings.Type, elementSettings.Description);
/* Example output
Type: Block Reference, Description: Damaged_Structure
*/
另请参阅
FeatureLayer.SetDefaultElementType - 此 .NET 方法用于设置要素图层的默认元素类型,如果成功,则将返回这些设置作为命名元组。
esri_featurelayer_getDefaultElementType - 此 AutoLISP 函数用于返回默认元素设置的关联列表。