4 Replies Latest reply on Jan 9, 2019 6:19 AM by chuckt

    Layer Toggle

    chuckt

      Have you ever wanted to quickly switch to a different layer while routing? Of course you have, F4... Duh!

       

      What if you want to switch to a layer that isn't part of your current layer pair, Lx<Enter>... I hate that.

       

      Several years ago I asked PADS to give us access to the currently active layer property, and a few versions later they actually did it. For various reasons I haven't put much effort into using it until this morning. I have this macro mapped to Alt+F4

       

      current_layer = Application.ActiveDocument.ActiveLayer

      if current_layer >= Application.ActiveDocument.ElectricalLayerCount then

        Application.ActiveDocument.ActiveLayer = 1

      else

        Application.ActiveDocument.ActiveLayer = current_layer + 1

      end if

       

      It will toggle to the next electrical layer and roll back to L1 after hitting the electrical layer count... I like that

      Using this macro in conjunction with the ZC modeless setting will display the layers one at a time, in succession... I like that too

       

      PS

      I actually have it mapped to Alt+4 also... because I mapped all the F keys to there corresponding number key so I don't need to stretch so far.

        • 1. Re: Layer Toggle
          md.direct

          Very nice.

           

          I have assigned the "+" sign to go next and "-" to go previous:

           

          current_layer = Application.ActiveDocument.ActiveLayer

          if current_layer <= 1 then

              Application.ActiveDocument.ActiveLayer = Application.ActiveDocument.ElectricalLayerCount

          else

              Application.ActiveDocument.ActiveLayer = current_layer - 1

          end if

           

           

          This way, it acts just like Altium ;-)

          • 2. Re: Layer Toggle
            buckles_667

            Hey,

             

            First off, what a great tip! One question. How did you map the macros to the "+", "-", or "Alt+F4" keys?

             

            Thanks!!!

             

            ~L

            • 3. Re: Layer Toggle
              buckles_667

              Hey,

               

              Actually I answered my own question but will post it for other curious parties. Here you go:

               

              Tools > Customize > Macro files

              Next add the macro > Macro Command Files

              then go back to > Commands > Categories > Macros, now you see your new macro in the list

              Next

              > Keyboard and Mouse > All modes > Macros > Double-click > Select macro > Current shortcuts > add > assign your new shortcut

               

              Hope that works!

               

              ~L

              • 4. Re: Layer Toggle
                chuckt

                I actually split that into two macros and mapped them to the mouse wheel, and a 3rd to return the "z" settings to normal mod.

                 

                NextLayer.mcr - mapped to Alt+<RotateForward>

                Application.ModelessCommand("z")

                DlgModelessCmd.Command = "zc"

                DlgModelessCmd.OnOk()

                current_layer = Application.ActiveDocument.ActiveLayer

                if current_layer >= Application.ActiveDocument.ElectricalLayerCount then

                Application.ActiveDocument.ActiveLayer = 1

                else

                Application.ActiveDocument.ActiveLayer = current_layer + 1

                end if

                 

                PrevLayer.mcr  -mapped to Alt+<RotateBackward>

                Application.ModelessCommand("z")

                DlgModelessCmd.Command = "zc"

                DlgModelessCmd.OnOk()

                current_layer = Application.ActiveDocument.ActiveLayer

                if current_layer = 1 then

                Application.ActiveDocument.ActiveLayer = Application.ActiveDocument.ElectricalLayerCount

                else

                Application.ActiveDocument.ActiveLayer = current_layer - 1

                end if

                 

                z-c&zz.mcr - mapped to Alt+MButton+<Click>

                Application.ModelessCommand("z")

                DlgModelessCmd.Command = "z-c"

                DlgModelessCmd.OnOk()

                Application.ModelessCommand("z")

                DlgModelessCmd.Command = "zz"

                DlgModelessCmd.OnOk()