Allegro PCB Design SKILL Tutorial


In the previous tutorial we gave the commands in a command line and saw the results in a command line window. It is possible to put all the commands in a file ( typically with extension .il) and then load the file from the command line. Let us say the content lf the file hello.il is

for( i 1 3 print( "hello" ))

If you save the file in the same directory as your allegro brd file, then you can give the following command that will run the contents of this file.

Commans > skill load("hello.il")

This will run the contents of the hello.il

However, it is not advisable to keep a copy in the local path, instead, you may like to follow the following steps

1. Create a directory c:\cadence\setup\skill
2. Create a new environment variable called ALLEGRO_PCBENV
ControlPanel->System->Advanced->Environment Variables->System->New

Name this ALLEGRO_PCBENV and Value=C:\cadence\setup

3. Create a file called allegro.ilinit file and paste the following content in that file
setSkillPath(buildString(append1(getSkillPath() "c:/Cadence/setup/skill" )))
  foreach(dir getSkillPath()
    when(isDir(dir)
           foreach(file rexMatchList("\\.il$" getDirFiles(dir))
        when(
           printf("Loading Skill file: %s\n" file)
           load(file)
      )
    )
  )
)


This il init file will load all the il files in the directory c:\cadence\setup\skill.

4. Restart the computer ( This is required, so that the environment variables take affect.
5. Now keep any .il file that you wish to run in the c:\cadence\setup\skill directory. As a test, if you place the hello.il file in the above example you will see that it prints

Hello, Hello, Hello

in the command line

Here is the youtube showing the action

In the next tutorial we will write some usefull skill scripts that does some real life job.

We are also looking for volunteer to contribute to this tutorial. Please write to info at referencedesigner.com if you can contribute.