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.
c:\DIR\rs274xjb.exe c:\tmp\demo.art
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
[General]
layers=layer1,layer2
aptfile=C:\tmp\1.APT
[layer1]
layer=1,C:\tmp\1.GBR
dxfcolor=1
[layer2]
layer=2,C:\tmp\2.GBR
dxfcolor=2
Explanation
This job contains 2 layers: layer1
and layer2
.
where
layer1 is the Gerber file c:\tmp\1.gbr
layer2 is the Gerber file c:\tmp\2.gbr
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 dxfcolor=1
and dxfcolor=2
.
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
APTUNITS inch
FORMAT 2.4
SUPPRESS LEADING
SUPPRESS TRAILING
CIRANG 90
CIRANG 360
ABSOLUTE on
ABSOLUTE off
PEND 0
PEND 1
PEND 1
is used, then the command line must include the argument -we
FLASH on
FLASH off
FLASH on2
FLASH tff
CIRCULAR on
GBR_END M02
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.
c:\wcad\asm500\gbr2gdxd.exe
"-cfg:c:\tmp\demo.apt"
"-out:c:\tmp\demo.dxf"
-f "c:\tmp\demo.job"
[-s:Scale]
[-we]
<-cir+ | -cir->
[-r14]
where
-cfg:
-out:
-f
-s:Scale
-we
-cir+
-cir-
-r14