3 Replies Latest reply on Sep 24, 2015 4:28 PM by vkhurana

    Does DxDesigner navigator have an API

    Andreas.Schaefer

      Hi,

       

      does anybody know whether the Navigator in DxDesigner has an API

      and which dll to source then ?

       

      Kind regards,

      Andreas

        • 1. Re: Does DxDesigner navigator have an API
          john_dube

          Andreas,

           

          There is no scripting API on the navigator. Is this related to the question about deleting pages or something else?

           

          John

          • 2. Re: Does DxDesigner navigator have an API
            Patrick.Cashman

            Andreas,

             

            You are not alone in hitting a brick wall when attempting to intereact with the Navigator.  I have also struggled considerably with it.  You rapidly discover that the normal method of iterating sheets using the standard sheet iteration produces bad results if the sheet numbers have been changed or rearranged.

             

            This works to cycle through the sheets but not always in the same order as the navigator:

             

            Public schms As ViewDraw.IStringList 'in a separate module

            Public sheets As ViewDraw.IStringList

             

            schms = app.SchematicSheetDocuments.GetAvailableSchematics

            sheets = app.SchematicSheetDocuments.GetAvailableSheets(schms.GetItem(1))

            app.SchematicSheetDocuments.open(schms.GetItem(1), sheets.GetItem(1))

             

            Apparently the navigator uses some other index for its sheet order.  I finally discovered how to do it:

             

            (vb.net, external executable)

             

            Public sheet_names as New ArrayList 'put this at the top of the class or in a separate module so it's available universally

             

            Sub get_sheet_names()

                    Dim blocks as Object

                    dim block as ViewDraw.Block

             

                    on error goto get_sheet_names_error_trap

             

                    design_name = app.GetProjectData.GetiCDBDesignRootBlock(app.GetActiveDesign())    'this is the schematic, not the board

                    blocks = app.QueryPages(design_name)

                    sheet_names.Clear

                    For Each block In blocks

                        sheet_names.Add(block.SheetNum)

                    Next

             

                    get_sheet_names_error_trap:

                    DX_Connect()

                    error_count = error_count + 1

                    If error_count > 4 Then

                        'me.Close

                        exit sub

                    End If

                    get_sheet_names()

             

                End Sub

             

            You'll notice the inelegant error trap.  I don't exactly remember why I put that there, but it's most likely that there is some random behavior I could not explain so I put that there to attempt to deal with it.  If anyone else can find a better way, please let me know.

             

            Anyway, you get an ordered list of sheet names, in this case in the arraylist sheet_names.  You can then use this to navigate to sheets as desired.

             

            Perhaps you are going some other way with your question, but even so I hope that this helps you work with the Navigator more easily.

            • 3. Re: Does DxDesigner navigator have an API
              vkhurana

              This is great Patrick.  Thanks for showing how to use Application.QueryPages to return the sheet order as displayed in the Navigator.