3 Replies Latest reply on Dec 21, 2015 2:42 AM by kenwhite

    macro for opening and closing the clearance menu

    kenwhite

      Hi

      I am new to pads layout and am trying to create some keyboard short cuts using macros.

      I have recorded a macro and created a shortcut that opens the Design rules – Default – Clearance.

      Using the following code.

      1. Application.ExecuteCommand("Setup Rules Cmd") // Opens Design rules
      2. RulesDlg.Default.Click() // Opens Default
      3. DefaultRulesDlg.Clearance.Click()// Opens Clearance

       

      What I want the macro to do is when I have set the clearance and clicked the ok, it closes the Clearance, Default and Design rules.

      The following code closes the Clearance, Default and Design rules.

      1. ClearanceRulesDlg.Ok.Click() //Ok button pressed on Clearance menu
      2. DefaultRulesDlg.Ok.Click() //Closed button pressed on Default menu
      3. RulesDlg.Ok.Click() //Closed button pressed on Design rules menu

       

      I am not sure how to had an if statement so the following code will work.

      1. Application.ExecuteCommand("Setup Rules Cmd")
      2. RulesDlg.Default.Click()
      3. DefaultRulesDlg.Clearance.Click()

      If ok is pressed ClearanceRulesDlg.Ok.Click()

      Then do this

      1. DefaultRulesDlg.Ok.Click()
      2. RulesDlg.Ok.Click()

       

      Any help will be greatly appreciated.

      Thanks

        • 1. Re: macro for opening and closing the clearance menu
          cathy_terwedow

          Welcome to PADS Ken! I've moved your question here to the PADS layout community where it should get a quicker response. - Cathy

          • 2. Re: macro for opening and closing the clearance menu
            chuckt

            I use 3 different macros for DRC checking. Basicly  checking for shorts (< design rule settings) , opens and to clear errors. I then map them to Alt+1, Alt+2, Alt+3. If I want to open the actual dialog box to inspect the errors I do it manually... but it's pretty easy to open it with a macro.

             

            Clearance:

            Application.ExecuteCommand("Tools Check Clearance")

            Application.ExecuteCommand("Redraw")

             

            Connectivity:

            Application.ExecuteCommand("Tools Check Continuity")

            Application.ExecuteCommand("Redraw")

             

            ClearERR:

            Application.ExecuteCommand("Check Clear Errors")

            Application.ExecuteCommand("Redraw")

            • 3. Re: macro for opening and closing the clearance menu
              kenwhite

              Hi chuck

               

              Thanks for the reply.

              The code you posted above is really usefull, i am going to map them to some keys.

              But the code i posted was for opening Clearance rules:Default rules. I want to be able to close the 3 windows when i click ok.

              I want to be able to open this window with short cut key and also close it when i click the ok button.

              I have also tryed Application.ExecuteCommand("Clearance Rules"), which works but all the values are wrong.

               

              once again thanks for your help so far chuck.

               

              Any help will be greatly appreciated.

              Thanks