There is no scripting API on the navigator. Is this related to the question about deleting pages or something else?
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))
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
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
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.
This is great Patrick. Thanks for showing how to use Application.QueryPages to return the sheet order as displayed in the Navigator.