This document is archived and information here might be outdated.  Recommended version.


Get A SchematicDiagram In A Schematic Dataset From The SchematicDiagram ID Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Get A SchematicDiagram In A Schematic Dataset From The SchematicDiagram ID Snippet

Retrieve a schematic diagram in a given schematic dataset from its ID

[C#]
/// <summary>
/// Retrieve a SchematicDiagram in a given SchematicDataset from its ID
/// </summary>
/// <param name="schemDataset">The SchematicDataset containing the SchematicDiagram</param>
/// <param name="schemDiagClass">The SchematicDiagramClass the schematic diagram is based on</param>
/// <param name="DiagramID">The ID of the SchematicDiagram to retrieve</param>
///  <returns>The retrieved ESRI.ArcGIS.Schematic.ISchematicDiagram</returns>
        public ESRI.ArcGIS.Schematic.ISchematicDiagram GetSchematicDiagramFromSchematicDatasetByID(ESRI.ArcGIS.Schematic.ISchematicDataset schemDataset, ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagClass, int DiagramID)
        {
                // cast SchematicDataset into ISchematicDiagramContainer
                ESRI.ArcGIS.Schematic.ISchematicDiagramContainer schDiagramCont=(ESRI.ArcGIS.Schematic.ISchematicDiagramContainer)schemDataset;

                return schDiagramCont.get_SchematicDiagramByID(schemDiagClass, DiagramID);
        }
[Visual Basic .NET]
''' <summary>
''' Retrieve a SchematicDiagram in a given SchematicDataset from its ID
''' </summary>
''' <param name="schemDataset">The SchematicDataset containing the SchematicDiagram</param>
''' <param name="schemDiagClass">The SchematicDiagramClass the schematic diagram is based on</param>
''' <param name="DiagramID">The ID of the SchematicDiagram to retrieve</param>
''' <returns>The retrieved ESRI.ArcGIS.Schematic.ISchematicDiagram</returns>
Public Function GetSchematicDiagramFromSchematicDatasetByID(ByVal schemDataset As ESRI.ArcGIS.Schematic.ISchematicDataset, ByVal schemDiagClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass, ByVal DiagramID As Integer) As ESRI.ArcGIS.Schematic.ISchematicDiagram
        ' cast SchematicDataset to ISchematicDiagramContainer
        Dim schDiagramCont As ESRI.ArcGIS.Schematic.ISchematicDiagramContainer=TryCast(schemDataset, ESRI.ArcGIS.Schematic.ISchematicDiagramContainer)

        Return schDiagramCont.SchematicDiagramByID(schemDiagClass, DiagramID)
End Function

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Schematic