Feature.ChangeElementType 方法用于更改点、多点或面要素选择集的元素类型。
声明
public bool Esri.ArcGISForAutoCAD.Feature.ChangeElementType(Document doc, SelectionSet selectionSet, string newElementTypeString, string newElementDescriptionString)
参数
| 类型 | 名称 | 描述 | 必填 |
|---|---|---|---|
文档 | doc | 要进行操作的 AutoCAD 文档。 | 必填 |
SelectionSet | selectionSet | AutoCAD 要素选择集。 | 必填 |
string | newElementTypeString | 默认元素类型 POINT、Block Reference 或 AECC_COGO_POINT。对于面,则为 Hatch 或 Automatic | 必填 |
string | newElementDescriptionString | 如果类型为 Block Reference,则为块名称;如果类型为 COGO Point,则为描述前缀;如果类型为 Hatch,则为面的影线模式名称。 | 如果为 Block Reference 或 AECC_COGO_POINT,则为必填项 |
返回
| 类型 | 描述 |
|---|---|
bool | 如果已成功更改实体类型,则为 true |
错误条件备注
如果参数无效,则此方法可能会抛出异常或者返回 false 或 null。
示例
打印使用名为 Damaged_Structure 的 AutoCAD 块插入更改所选集的元素设置成功。// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var selectionSet = doc.Editor.GetSelection().Value;
// Change to the designated block
var success = Esri.ArcGISForAutoCAD.Feature.ChangeElementType(doc, selectionSet, "Block Reference", "Damaged_Structure");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
另请参阅
esri_feature_changeElementType - 此 AutoLISP 函数用于更改要素选择集的元素类型。