2 Replies Latest reply on Apr 1, 2016 5:16 AM by 15e6ad19-6d34-8b46-0100-014f0327e866

    How to make a specific sheet in Drawing Editor active using VB .NET

    15e6ad19-6d34-8b46-0100-014f0327e866

      Looks like there is no active document command in VB .NET for drawing editor application.

      Could you please check and let us know if there is any alternate solution for this ASAP?

       

      Appreciate any quick response on this.

        • 1. Re: How to make a specific sheet in Drawing Editor active using VB .NET
          Patrick.Cashman

          This is not exactly what you are looking for, but I think it will help you get there:

           

          (I assume you already have a hook into the Drawing Editor document.  If you don't have that, post up and we can get you there.)

           

               Sub test_app()

                   Dim sheets As MGCPCB.Sheets

                   Dim sheet As MGCPCB.Sheet

                   Dim current_sheet As String

                  

                   current_sheet = doc.ActiveSheet.Name

                  

                   sheets = doc.Sheets

                   For Each sheet In sheets

                       doc.ActiveSheet = sheet

                       'do something here on each sheet

                   Next

                  

                   For Each sheet In sheets

                       If sheet.Name = current_sheet Then

                           doc.ActiveSheet = sheet

                       End If

                   Next

               End Sub

           

           

          You could iterate the sheets, get their names and add them to a combobox or some other control where the names are visible, then use that to select a specific sheet.

          • 2. Re: How to make a specific sheet in Drawing Editor active using VB .NET
            15e6ad19-6d34-8b46-0100-014f0327e866

            Thanks a lot, Patrick.

            Using your code we eventually achieved what we were after. Thank you.