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


Insert A SchematicBuilderRule On A Schematic Diagram Class Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Insert A SchematicBuilderRule On A Schematic Diagram Class Snippet

Insert a schematic rule on a schematic diagram class at a specific position

[C#]
        /// <summary>
        /// Insert a SchematicBuilderRule on a SchematicDiagramClass at a specific position
        /// </summary>
        /// <param name="schemDiagramClass">The SchematicDiagramClass on which the schematic rule must be inserted</param>
        /// <param name="OrderNumber">Position of the new SchematicBuilderRule</param>
        /// <returns>The inserted SchematicBuilderRule</returns>
        public ESRI.ArcGIS.Schematic.ISchematicBuilderRule InsertSchematicBuilderRuleToDiagramClassByName(ESRI.ArcGIS.Schematic.ISchematicDiagramClass schemDiagramClass, int OrderNumber)
        {
                // cast SchematicDiagramClass into ISchematicBuilderRuleContainerEdit
                ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainerEdit schBuilderRuleEditCont=(ESRI.ArcGIS.Schematic.ISchematicBuilderRuleContainerEdit)schemDiagramClass;

                return schBuilderRuleEditCont.InsertSchematicBuilderRule(OrderNumber);
        }
[Visual Basic .NET]
    ''' <summary>
    ''' Insert a SchematicBuilderRule on a SchematicDiagramClass at a specific position
    ''' </summary>
    ''' <param name="schemDiagramClass">The SchematicDiagramClass on which the schematic rule must be inserted</param>
    ''' <param name="OrderNumber">Position of the new SchematicBuilderRule</param>
    ''' <returns>The inserted SchematicBuilderRule</returns>
    Public Function InsertSchematicBuilderRuleToDiagramClassByName(ByVal schemDiagramClass As ESRI.ArcGIS.Schematic.ISchematicDiagramClass, ByVal OrderNumber As Integer) As ESRI.ArcGIS.Schematic.ISchematicBuilderRule

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

        Return schBuilderRuleEditCont.InsertSchematicBuilderRule(OrderNumber)
    End Function

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