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


Get The Number Of Schematic Rules Configured On A SchematicDiagramClass Snippet (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference

Get The Number Of Schematic Rules Configured On A SchematicDiagramClass Snippet

Get the number of schematic rules configured on a SchematicDiagramClass

[C#]
        /// <summary>
        /// Get the number of schematic rules configured on a SchematicDiagramClass
        /// </summary>
        /// <param name="schemDiagramClass">The SchematicDiagramClass where the schematic rules are configured</param>
        /// <returns>The number of rules [Integer]</returns>
        public int CountSchematicBuilderRulesFromDiagramClassByName(ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagramClass)
        {
                // cast SchematicDiagramClass into ISchematicBuilderRuleContainer
                ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainer schBuilderRuleCont=(ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainer)schemDiagramClass;

                return schBuilderRuleCont.SchematicBuilderRuleCount;
        }
[Visual Basic .NET]
        ''' <summary>
        ''' Get the number of schematic rules configured on a SchematicDiagramClass
        ''' </summary>
        ''' <param name="schemDiagramClass">The SchematicDiagramClass where the schematic rules are configured</param>
        ''' <returns>The number of rules [Integer]</returns>
        Public Function CountSchematicBuilderRulesFromDiagramClassByName(ByVal schemDiagramClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass) As Integer

                ' cast SchematicDiagramClass into ISchematicBuilderRuleContainer
                Dim schBuilderRuleCont As ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainer=TryCast(schemDiagramClass, ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainer)

                Return schBuilderRuleCont.SchematicBuilderRuleCount
        End Function

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