Assigning a script to a process launcher

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

You have the ability to assign a script to a server menu, toolbar or hot key in DXP which makes it possible for you to run the script over a current PCB document for example. You will need to specify the full path to a project where the script resides in and specify which unit and procedure to execute the script.

There are two parameters in this case: the ProjectName and the ProcName. For the ProcName parameter, you need to specify the script filename and the procedure. So the format is as follows: ProcName = ScriptFileName>ProcedureName. Note the GreaterThan (>) symbol used between the script file name and the procedure name.

Assigning to a process launcher example

To illustrate this ability to assign a script to a resource, we will open a PCB document in DXP and then;

1. Double click on the PCB menu and the Customizing PCB Editor dialog appears.

2. Click on the New button from the Customizing PCB Editor dialog.

3. Choose ScriptingSystem:RunScript process in the Process: field of the Customizing PCB Editor dialog.

4. Enter ProjectName = C:\Program Files\Altium2004\Examples\Scripts\General\HelloWorld.PrjScr | ProcName = HelloWorldDialog>RunHelloWorld text in the Parameters: field for example.

 

5. You will need to give a name to this new command and assign a new icon if you wish. In this case, the name is PCBScript in the Caption: field of this dialog. The new commands appear in the [Custom] category of the Categories list. Click on the [Custom] entry from the Categories list. The PCBScript command appears in the Commands list of this dialog.

6. You then need to drag the new PCBScript command onto the PCB menu from the Customizing PCB Editor dialog. The command appears on the menu. You can then click on this new command and the HelloWorldDialog form appears.

Your Ad Here