FeatureLayer.Remove 方法用于从工程图中移除要素图层定义,或者,如果为 web 要素图层,则将从工程图中移除图层定义及其实体。 此方法还将忽略尚未同步的指定 web 要素图层的所有编辑内容。
声明
public bool Esri.ArcGISForAutoCAD.FeatureLayer.Remove(Document doc, string flName)
参数
| 类型 | 名称 | 描述 | 必填 |
|---|---|---|---|
文档 | doc | 要进行操作的 AutoCAD 文档。 | 必填 |
string | flName | 工程图中现有的要素图层名称。 | 必填 |
返回
| 类型 | 描述 |
|---|---|
bool | 如果已成功移除要素图层,则为 true |
错误条件备注
如果参数无效,则此方法会抛出异常或者返回 false 或 null。
示例 1
打印从当前工程图中移除 Shelters web 要素图层连接和实体成功。// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Remove the web feature layer
var success = Esri.ArcGISForAutoCAD.FeatureLayer.Remove(doc, "Shelters");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
示例 2
打印从当前工程图中移除 Streets 文档要素图层定义成功。// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Remove the document feature layer
var success = Esri.ArcGISForAutoCAD.FeatureLayer.Remove(doc, "Streets");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
另请参阅
esri_featurelayer_remove - 此 AutoLISP 函数用于从工程图中移除要素图层。