Question for forum:
I’m currently working on a code
to automatically add CLP files to DRA files and then add two classes called “APPROVED”
and “CLP”. To do this manually you have to open a DRA file, click file import subdrawing
and choose the clp file with the same name as dra. (path already set). You then
set the clp to position x 0 0. And then click on Set Up > Subclasses >
Package geometry and type in “Approved” and “Clp.”
So far we’ve recorded the macros
in Allegro for all of these actions. The macros correspond to one specific file
name and we want to apply this to numerous files. To do this we created a
python program that locates all of the specified CLP and DRA files, and if they
have a matching name, runs a for loop that puts each file name into a stored
variable that runs a loop for each file. We converted this script into batch
and then added a function that we thought would run Allegro macros from batch.
In order to get the script
working, we need to have an allegro batch command that will run the script
without opening the Allegro start popup, or closing the popup when it appears. We need to do this to run any script from
I’ve done another similar program
in batch where I made a for loop for each dra file and within the loop there
was a batch a2dxf command that converted all dra files to dxf files. Is there a
similar batch command for adding clp files to position 0 0 and/ or adding
classes? If anyone has done something similar please let me know!
Thank you very much for the help.
By the "allegro pop-up" do you mean the "license picker"? If you do, set a license default for the duration of running the scripts and ensure that one license token of that product is available, or use the "-product <product license name>" command line option to "just use that product license" for running the scripts. There is an enhancement request submitted to add a "use any license" mode command line option to run scripts without being prompted for a license, which will be OK as long as "some" license token is available to run allegro.
If you mean the "allegro UI" popping up, there is a "-nograph" option to run allegro without the canvas appearing but my scripts seem to have been ineffective when I have tried to use this option in the past. See the allegro.txt file in the product installation at share\pcb\batchhelp for allegro command line options, the "-product" option, and other options, are documented in that file as well.