This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get The Selected In-Memory Schematic Features In A ISchematicLayer Snippet (ArcObjects .NET 10.4 SDK) |
Retrieve all the in-memory schematic features currently selected in a ISchematicLayer. The schematic layer needs to be loaded in memory
/// <summary> /// Retrieve all the in-memory schematic features currently selected in a ISchematicLayer /// </summary> /// <param name="schemLayer">The ISchematicLayer where the in-memory schematic features are selected</param> /// <param name="OnlyVisible">If OnlyVisible is true, only the visible selected features are returned</param> /// <returns>The retrieved IEnumSchematicInMemoryFeature</returns> public IEnumSchematicInMemoryFeature GetSelectedInMemoryFeatureFromSchematicLayer(ESRI.ArcGIS.Schematic.ISchematicLayer schemLayer, bool OnlyVisible) { // cast SchematicLayer into ISchematicLayerEditHelper - the schematic layer needs to be loaded in memory ESRI.ArcGIS.Schematic.ISchematicLayerEditHelper shemLayerHelper=(ESRI.ArcGIS.Schematic.ISchematicLayerEditHelper)schemLayer; return shemLayerHelper.GetSchematicInMemorySelectedFeatures(OnlyVisible); }
''' <summary> ''' Retrieve all the in-memory schematic features currently selected in a ISchematicLayer ''' </summary> ''' <param name="schemLayer">The ISchematicLayer where the in-memory schematic features are selected</param> ''' <param name="OnlyVisible">If OnlyVisible is true, only the visible selected features are returned</param> ''' <returns>The retrieved IEnumSchematicInMemoryFeature</returns> Public Function GetSelectedInMemoryFeatureFromSchematicLayer(ByVal schemLayer As ESRI.ArcGIS.Schematic.ISchematicLayer, ByVal OnlyVisible As Boolean) As ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature ' cast SchematicLayer into ISchematicLayerEditHelper - the schematic layer needs to be loaded in memory Dim schemLayerHelper As ESRI.ArcGIS.Schematic.ISchematicLayerEditHelper=TryCast(schemLayer, ESRI.ArcGIS.Schematic.ISchematicLayerEditHelper) If schemLayerHelper Is Nothing Then Return Nothing Return schemLayerHelper.GetSchematicInMemorySelectedFeatures(OnlyVisible) End Function