You are here

How to automatically replay a script when starting OrCAD PCB Editor


I have a script (.scr) file that I want to run automatically when OrCAD PCB Editor is invoked from the command line, terminal window, or a shortcut. How can I do that?


You can use the following methods for replaying a script at startup whenever OrCAD PCB Editor is invoked.

Method 1

For running a script (.scr) file automatically when OrCAD PCB Editor is invoked from the command line or terminal window, you can use a switch specifying the script file as follows:

allegro -s <script_path>\<script_name>.scr

Multiple -s options might be specified, and they will be replayed in order on the command line. 


-s script1 -s script2 ... -s scriptN

​Note: This works for both Windows and Linux OS.

The script_path can be configured in OrCAD PCB Editor by going to Setup > User Preferences > Paths > Config > scriptpath.


Along with this, the script_startup environment variable can be used to specify which script will be run when OrCAD PCB Editor is started. This variable is found in Setup > User Preferences > Ui > Script.

Here, you can mention the name of the script file (for example, myscript.scr) that you want to start automatically as the OrCAD PCB Editor tool is invoked.


Method 2

For replaying a script whenever OrCAD PCB Editor is opened, you can perform the following steps:

  1. Go to Setup > User Preferences > Paths > Config > scriptpath and add the path where your script (.scr) files are present.
  2. Go to Setup > User Preferences > Ui > Script and use the script_startup field to assign the script name that is present within your scriptpath (for example, “myscript.scr”).
  3. Rename the script file that needs to be run at startup by prepending a program name (that could be OrCAD PCB Editor or pad_designer).

    For example, suppose "myscript.scr" is a script file from the previous step (step 2), which needs to be executed at the startup of OrCAD PCB Editor. Modify its name and change it to "allegro_myscript.scr". This file should be saved and present within your scriptpath.

Now, whenever OrCAD PCB Editor is invoked, the allegro_myscript.scr file, which is present in your scriptpath, will be replayed automatically. (This will work irrespective of projmgr or OrCAD PCB Editor directly.)

Note: Same will be valid for pad_designer. If you want to run any script at the startup of pad_designer, prepend the script name as "pad_designer<script_name>.scr" and save this scr file in your scriptpath.

Method 3

On Windows platform, create a shortcut to PCB Editor on the Desktop. Right-click on the shortcut and select Properties. Change the Target field value to include -s <scriptname> at the end. Then, pick up the board file you want to open and drop it on this shortcut.

You can add multiple script files here as follows:

-s script1 –s script2…-s scriptN