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

    Does DxDesigner navigator have an API




      does anybody know whether the Navigator in DxDesigner has an API

      and which dll to source then ?


      Kind regards,


        • 1. Re: Does DxDesigner navigator have an API



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



          • 2. Re: Does DxDesigner navigator have an API



            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)


                    For Each block In blocks






                    error_count = error_count + 1

                    If error_count > 4 Then


                        exit sub

                    End If



                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

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