Gbrunmgr Command Line Examples
Gbrunmgr is extremely powerful and has an enormous number of options and controls as well as the ability to a number of different output formats. So we can't cover every possible command line possibility. We'll try to show the more common operations in the following examples.
Files, Paths and Abbreviations
When using the command line, best practice is to fully define the path as part of the filename. If you use relative path or no path then you risk your script or batch file breaking.
Current Directory - on Windows the batch/scripting variable for the current directory is %CD%. I typically like to place and execute my batch files from a directory which also holds the input data. I will use that convention in these examples.
Quoting of Directories - if a directory or file name has a space or special character in it the entire command should be surrounded by double quotes. i.e
Command Line Breaks and Indents - In all the examples below you will see "breaks" in the command line. This is only for readability.Executable - In all examples below I've used
1. Clip Out a Window and Convert to AutoCAD DXF
We want to convert a rectangular window of our file into a nice clean DXF that will be used for documentation purposes. We want a clean DXF layer even if the Gerber file has many internal layers. We will maintain the same units and coordinates as the Gerber input file.
gbrunmgr.exe executable "%CD%\icsxseed.gbr" input RS274X file (units=inch) "-out:%CD%\output\icxseed.dxf" output DXF file "-wdir:%CD%\working" working directory -window:3.5,6.6,4.85,7.9 LLx,LLy,URx,URy to extract -outputtype:dxf output file format -polyformat:leonov polygon format -arcsag:0.0002 arc smoothness
Below you can see our Gerber input file and the resulting DXF output of the window we selected:
Below is a three stage example which creates a multi layered GDSII output file: (1) Generate a GDSII file for each Gerber file [5v.gds, gnd.gds, and top.gds are created from three different Gerber files] [5v.art ==> 5v.gds] "c:\wcad\gbrvu\gbrunmgr.exe" "d:\temp\5v.art" "-out:d:\temp\5v.gds" "-wdir:d:\temp" -outputtype:gds_stream -sizingvalue:0.000 -smoothingvalue:0.005 -maxpoints:2000 -arcres:45.000 -silent -singledlg [gnd.art ==> gnd.gds] "c:\wcad\gbrvu\gbrunmgr.exe" "d:\temp\gnd.art" "-out:d:\temp\gnd.gds" "-wdir:d:\temp" -outputtype:gds_stream -sizingvalue:0.000 -smoothingvalue:0.005 -maxpoints:2000 -arcres:45.000 -silent -singledlg [top.art ==> top.gds] "c:\wcad\gbrvu\gbrunmgr.exe" "d:\temp\top.art" "-out:d:\temp\top.gds" "-wdir:d:\temp" -outputtype:gds_stream -sizingvalue:0.000 -smoothingvalue:0.005 -maxpoints:2000 -arcres:45.000 -silent -singledlg (2) Map outputs to desired layers [All output is initially on layer one] [Map 5v layer one to layer five.] c:\wcad\gbrvu\gdsfilte.exe d:\temp\5v.gds d:\temp\5v_lyr1to5.gds = -unixcmdline -lyr1:5 [Map gnd layer one to layer six.] c:\wcad\gbrvu\gdsfilte.exe d:\temp\gnd.gds d:\temp\gnd_lyr1to6.gds = -unixcmdline -lyr1:6 [Map top layer one to layer seven.] c:\wcad\gbrvu\gdsfilte.exe d:\temp\top.gds d:\temp\top_lyr1to7.gds = -unixcmdline -lyr1:7 (3) Blend all mapped GDSII output into one file [Blend all three layer mapped files into one file called blend.gds] c:\wcad\gbrvu\gdsfilte.exe d:\temp\5v_lyr1to5.gds d:\temp\blend.gds = -unixcmdline -blend d:\temp\gnd_lyr1to6.gds d:\temp\top_lyr1to7.gds GDSFILT USAGE-- The gdsfilte.exe usage is as follows: gdsfilte.exe inputfile outputfile topstr [options] outputfile is the GDS output file name. only topstr and its dependents are output. if topstr is '=' then, the structure with the deepest tree is selected. options can be some of -unixcmdline Perform GDSII scan (necessary in this context) -lyrM:N,... Remap layer range M to N. -dtpM:N,... Remap datatype range M to N. -mapM%N:m%n,... Remap layer:datatype(s) M:N to m:n. -blend f1 f2 ... fn blend files f1, f2 ... fn with inputfile.