This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get The Selected Schematic Features In A ILayer Snippet (ArcObjects .NET 10.4 SDK) |
Retrieve the schematic features currently selected in a ILayer
/// <summary> /// Retrieve the schematic features currently selected in a ILayer /// </summary> /// <param name="esriLayer">The ILayer where the schematic features are selected</param> /// <param name="OnlyVisible">If OnlyVisible is true, only the visible selected features are returned</param> /// <returns>The retrieved IEnumSchematicFeature</returns> public ESRI.ArcGIS.Schematic.IEnumSchematicFeature GetSelectedFeatureFromLayer(ESRI.ArcGIS.Carto.ILayer esriLayer, bool OnlyVisible) { // cast Layer into ISchematicLayer ESRI.ArcGIS.Schematic.ISchematicLayer schLayer=(ESRI.ArcGIS.Schematic.ISchematicLayer)esriLayer; if (schLayer == null) return null; return schLayer.GetSchematicSelectedFeatures(OnlyVisible); }
''' <summary> ''' Retrieve the schematic features currently selected in a ILayer ''' </summary> ''' <param name="esriLayer">The ILayer where the schematic features are selected</param> ''' <param name="OnlyVisible">If OnlyVisible is true, only the visible selected features are returned</param> ''' <returns>The retrieved IEnumSchematicFeature</returns> Public Function GetSelectedFeatureFromLayer(ByVal esriLayer As ESRI.ArcGIS.Carto.ILayer, ByVal OnlyVisible As Boolean) As ESRI.ArcGIS.Schematic.IEnumSchematicFeature ' cast Layer into ISchematicLayer Dim schLayer As ESRI.ArcGIS.Schematic.ISchematicLayer=TryCast(esriLayer, ESRI.ArcGIS.Schematic.ISchematicLayer) If schLayer Is Nothing Then Return Nothing Return schLayer.GetSchematicSelectedFeatures(OnlyVisible) End Function