This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Loop On The Schematic Attributes Related To A Schematic Element Class Snippet (ArcObjects .NET 10.4 SDK) |
Looping on all the schematic attributes related to a given SchematicElementClass
/// <summary> /// Looping on all the schematic attributes related to a SchematicElementClass /// </summary> /// <param name="schemElementClass">The SchematicElementClass the attributes are related to</param> public void SchematicAttributeFromElementClass(ESRI.ArcGIS.Schematic.ISchematicElementClass schemElementClass) { // cast SchematicElementClass into ISchematicAttributeContainer ESRI.ArcGIS.Schematic.ISchematicAttributeContainer schAttributeCont=(ESRI.ArcGIS.Schematic.ISchematicAttributeContainer)schemElementClass; // retrieve all the SchematicAttribute in the schematic attribute container ESRI.ArcGIS.Schematic.IEnumSchematicAttribute enumAttribute=schAttributeCont.SchematicAttributes; enumAttribute.Reset(); // get the first SchematicAttribute ESRI.ArcGIS.Schematic.ISchematicAttribute schAttribute=enumAttribute.Next(); bool isOk=false; while (schAttribute != null) { // TODO: add your code here, set isOk to true to exit the loop if (isOk) break; // get the next SchematicAttribute schAttribute=enumAttribute.Next(); } }
''' <summary> ''' Looping on all the schematic attributes related to a SchematicElementClass ''' </summary> ''' <param name="schemElementClass">The SchematicElementClass the attributes are related to</param> ''' <remarks></remarks> Public Sub SchematicAttributeFromElementClass(ByVal schemElementClass As ESRI.ArcGIS.Schematic.ISchematicElementClass) ' cast SchematicElementClass into ISchematicAttributeContainer Dim schAttributeCont As ESRI.ArcGIS.Schematic.ISchematicAttributeContainer=TryCast(schemElementClass, ESRI.ArcGIS.Schematic.ISchematicAttributeContainer) ' retrieve all the SchematicAttribute in the schematic attribute container Dim enumAttribute As ESRI.ArcGIS.Schematic.IEnumSchematicAttribute=schAttributeCont.SchematicAttributes enumAttribute.Reset() ' get the first SchematicAttribute Dim schAttribute As ESRI.ArcGIS.Schematic.ISchematicAttribute=enumAttribute.Next() Dim isOk As Boolean=False While (schAttribute IsNot Nothing) ' TODO: add your code here, set isOk to True to exit the loop If (isOk) Then Exit While ' get the next SchematicAttribute schAttribute=enumAttribute.Next() End While End Sub