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.
- Application.ExecuteCommand("Setup Rules Cmd") // Opens Design rules
- RulesDlg.Default.Click() // Opens Default
- 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.
- ClearanceRulesDlg.Ok.Click() //Ok button pressed on Clearance menu
- DefaultRulesDlg.Ok.Click() //Closed button pressed on Default menu
- 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.
- Application.ExecuteCommand("Setup Rules Cmd")
If ok is pressed ClearanceRulesDlg.Ok.Click()
Then do this
Any help will be greatly appreciated.