This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get A SchematicAttribute Related To A SchematicDiagramClass Snippet (ArcObjects .NET 10.4 SDK) |
Retrieve a SchematicAttribute related to a given SchematicDiagramClass from its name
/// <summary> /// Retrieve a SchematicAttribute related to a given SchematicDiagramClass from its name /// </summary> /// <param name="schemDiagramClass">The SchematicDiagramClass the attribute is related to</param> /// <param name="AttributeName">The schematic attribute name</param> /// <returns>The retrieved ESRI.ArcGIS.Schematic.ISchematicAttribute</returns> public ESRI.ArcGIS.Schematic.ISchematicAttribute GetSchematicAttributeFromDiagramClassByName(ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagramClass, string AttributeName) { // cast SchematicDiagramClass into ISchematicAttributeContainer ESRI.ArcGIS.Schematic.ISchematicAttributeContainer schAttributeCont=(ESRI.ArcGIS.Schematic.ISchematicAttributeContainer)schemDiagramClass; // the second parameter is set to True for a recursive search return schAttributeCont.GetSchematicAttribute(AttributeName, true); }
''' <summary> ''' Retrieve a SchematicAttribute related to a given SchematicDiagramClass from its name ''' </summary> ''' <param name="schemDiagramClass">The SchematicDiagramClass the attribute is related to</param> ''' <param name="AttributeName">The schematic attribute name</param> ''' <returns>The retrieved ESRI.ArcGIS.Schematic.ISchematicAttribute</returns> Public Function GetSchematicAttributeFromDiagramClassByName(ByVal schemDiagramClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass, ByVal AttributeName As String) As ESRI.ArcGIS.Schematic.ISchematicAttribute ' cast SchematicDiagramClass into ISchematicAttributeContainer Dim schAttributeCont As ESRI.ArcGIS.Schematic.ISchematicAttributeContainer=TryCast(schemDiagramClass, ESRI.ArcGIS.Schematic.ISchematicAttributeContainer) ' the second parameter is set to True for a recursive search Return schAttributeCont.GetSchematicAttribute(AttributeName, True) End Function