8 Replies Latest reply on Jan 29, 2018 8:08 AM by .-.--.--

    VX Navigator

    shainaor

      Hi,

      I'm looking for a way to automate the sheet order in the navigator window.

      couldn't find any reference for it in Mentor documentation.

      any help is welcome,

       

      Shain

        • 1. Re: VX Navigator
          Patrick.Cashman
          1 of 1 people found this helpful
          • 2. Re: VX Navigator
            .-.--.--

            Actually, the SchematicSheetDocuments object has two hidden methods that access sheet order:

                 SchematicSheetDocuments.GetSheetOrder(SchematicName As String) As StringList

                 SchematicSheetDocuments.SetSheetOrder(SchematicName As String, sheetRange As StringList)

            The methods are hidden because they are not supported by documentation, so their functionality is not guaranteed to work.  But, you can play with them to see if they work for you. You will need familiarity with manipulation of StringLists, and you will need to create your own sort routine to establish order.

            2 of 2 people found this helpful
            • 3. Re: VX Navigator
              Patrick.Cashman

              Boom.  Another winner.

              • 4. Re: VX Navigator
                .-.--.--

                So, I did some more playing with these methods to see if they work, and they do.  The following script gets the current sheet order, reverses it, and then applies it.  I figured that if it worked once, I could run it again, and reset to the original order.  You will have to figure out how you want to sort your list of sheets.

                 

                For Each Sch In SchematicSheetDocuments.GetAvailableSchematics

                     Set List = SchematicSheetDocuments.GetSheetOrder(Sch)

                     Sum = List.GetCount

                     For Inc = Sum To 1 Step -1

                          Call List.Insert(List.GetItem(Sum),Sum - Inc + 1)

                          Call List.Remove(Sum + 1)

                     Next

                     Call SchematicSheetDocuments.SetSheetOrder(Sch,List)

                Next

                1 of 1 people found this helpful
                • 5. Re: VX Navigator
                  shainaor

                  Many thanks !!!

                  I ran the script and it does work, the sheet order was change.

                  my problem, the way we use the navigator to represent the page name is (taken from settings-> navigator->sheets) : Sheet $(Number):  $(Name)

                  so when changing the order, the page name do change but the sheet number "moves" with the page name as follows. do you think that it is possible to change that as well?

                   

                  Shai

                   

                  • 6. Re: VX Navigator
                    .-.--.--

                    At our site, the Navigator > Sheets > Label format has always been set to $(Name), so we never see the internal $(Number) property, which is apparently controlled by Project > Boards > Sheet Numbering.  So try this: after running the script (and again, you need to determine how the script reorders your sheets), run Setup > Settings, then hit OK without changing anything, and the sheet numbers should update.  Unfortunately, there is no way to automate this last step.

                    2 of 2 people found this helpful
                    • 7. Re: VX Navigator
                      shainaor

                      works like magic.

                       

                      Many thanks for the help.
                      BTW - how did you come with the solution?

                      • 8. Re: VX Navigator
                        .-.--.--

                        For finding GetSheetOrder and SetSheetOrder, I used the Excel Visual Basic Object Browser, targeted the ViewDraw reference, displayed the hidden members, and then searched for SheetOrder.  Fixing the sheet numbering was purely an experiment that I expected to work.  Apparently, SetSheetOrder is missing some internal call that would automatically update the sheet numbers, so now we know why it is hidden and not documented.