AnsweredAssumed Answered

macro for opening and closing the clearance menu

Question asked by kenwhite on Dec 15, 2015
Latest reply on Dec 21, 2015 by 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

Outcomes