The GBR2DXF program has two parts - a user interface (GUI) that collects the information about the translation and an engine that actually does the conversion. If you wanted to run GBR2DXF from another program you can call the engine directly. To do so, you must know the correct command line syntax and also what resource files must be produced in advance of calling the engine.
This will generate the job file,
demo.job, the aperture file,
demo.apt and possibly a set of macro files,
rs274mac.* if the 274X file contains aperture macro definitions. These macro files are referenced by the aperture and are necessary for translation. After running
rs274xjb.exe, refer to sections 2. and sections 3. for further control settings your application may wish to modify in the job and aperture files.
If you are dealing with RS274D, then your application will have to generate the .job and .apt file on its own. The guidelines for the Job and Apt files are shown below.
Example of a job file
This job contains 2 layers:
layer1 is the Gerber file
layer2 is the Gerber file
The aperture file used for this job is
c:\tmp\1.apt as specified in aptfile.
The DXF output unit is
dxfunit=INCH and output to
dxffile=c:\tmp\1.dxf. The color in the
DXF output for each gerber file is defined in
Note:the dxfcolor line is not generated automatically by the rs274job.exe program but your application could add it in manually if you need to control the DXF layer color.
This can be problematic if you are accepting RS274D files from a variety of sources since there is no agreed upon format for the aperture information. Below is the syntax needed by the gbr2dxf engine.
Aperture File Example
PEND 1is used, then the command line must include the argument
Apertures used for drawing are separate from apertures used as flashes. This is a legacy behavior from gbr2dxf's early design.
D10 0.0000 d Round 0.0010 0.0010
D11 BLOCK11 f Rect 0.0300 0.0200
Assuming that you have correctly created the .job and .apt (and .mac files if coming from RS274X) then you are ready to launch the translation engine. The command line is broken into multiple lines for clarity but of course, you should not do so.
<-cir+ | -cir->