Skip To Content

FeatureLayer.SetDefaultElementType (.NET)

FeatureLayer.SetDefaultElementType 方法用于设置要素图层的默认元素类型,如果成功,则将返回这些设置作为命名元组。

声明

public (string Type, string Description) Esri.ArcGISForAutoCAD.FeatureLayer.SetDefaultElementType(Document doc, string flName, string type, string description, string sublayerName = null)

参数

类型名称描述必填

文档

doc

要进行操作的 AutoCAD 文档。

必填

string

flName

工程图中现有的点、多点或面要素图层。

必填

string

type

PointBlock ReferenceAECC_COGO_POINT 实体类型。 对于面影线,类型值为 HatchAutomaticAutomatic 将忽略面的任何影线填充符号。

必填

string

description

如果类型为 Block Reference,则为块名称;如果类型为 AECC_COGO_POINT,则为描述;对于面,则为影线模式名称。

必填

string

sublayerName

工程图中指定 flName 要素图层的现有子图层名称。

可选

返回

类型描述

(string Type, string Description)

命名元组,其中第一个值为 Type 值,第二个值为 Description 值。 Type 值为 POINTBlock ReferenceCOGO Point 实体类型;对于面,该值为 HatchAutomaticDescription 值为块参考名称、COGO 点描述前缀或影线模式名称。

错误条件备注

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

示例

将名为 Damage_to_Residential_Buildings 的要素图层的默认元素设置设置为名为 Damaged_Structure 的 AutoCAD 块参考,并打印已更新的默认元素设置。

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var flName = "Damage_to_Residential_Buildings"; 

// Set the element settings
var elementSettings = Esri.ArcGISForAutoCAD.FeatureLayer.SetDefaultElementType(doc, flName, "Block Reference", "Damaged_Structure");

// Print the element settings
doc.Editor.WriteMessage("Type: {0}, Description: {1}", elementSettings.Type, elementSettings.Description);

/* Example output
Type: Block Reference, Description: Damaged_Structure
*/

另请参阅

FeatureLayer.GetDefaultElementType - 此 .NET 方法用于获取要素图层的默认元素类型设置。

esri_featurelayer_setDefaultElementType - 此 AutoLISP 函数用于设置要素图层的默认元素类型。