web page header

Library

ODB2GDS is also available as a library. The functions are documented below:

 

Code Flow Hints

GDSII Flow



Core and Exec Functions

openODB

convertODBInput

closeODB

Information Functions

getODBOutputDir

getODBWorkingDir

getODBLastErr

getODBStepCount

getODBStepInfoList

freeODBStepInfoList

getODBTopStepListName

getODBTopStepListIndex

getODBMostLikelyTopStepName

getODBMostLikelyTopStepIndex

 

getODBStepName

getODBStepIndex

getODBStepNameProfileExtent

getODBStepIdxProfileExtent

getODBLayerCount

getODBLayerInfoList

freeODBLayerInfoList

getODBLayerName

getODBLayerIndex

getODBOutScale

getODBOutMirror

getODBOutPolarity

getODBProfileInch

getODBProfileMM

freeODBProfile

 

getODBSymbolInfoList

freeODBSymbolInfoList

getODBInfo

freeODBInfo

ACS_getODBVersion

ACS_getODBRcs

ACS_getODBDate

Specialized Functions

printODBTree

ACS_convertODBAttr

createODBOutputAttr

createODBOutputPlot

createODBOutputDynTxt

ACS_setODBArcres

ACS_setODBArcsag

setParentDlg



 

openODB

Description

Reads the ODB++ database; if it the input is a .tgz or .tar file it must be uncompressed/unpacked and copied to a temporary directory/file in the working directory. If it is already a directory then it is copied (unless specifically instructed not to) to a temporary directory/file under the working directory.

The license for the library is also checked out at upon execution of this function. Different licenses will be required for different outputs: gbr, gdsii, mic and oasis.

Syntax

int ACS_openODB
   (char * odbName, char * workingDir, struct ODB_InputParam * odbInitPtr);

Arguments

  odbName     - name of the odb (compressed file or path to uncompressed odb directory)

  workingDir  - if not NULL and is a valid path this will be set as the working dir. 
              - if NULL or invalid, the working dir will be set to the value of the
                TEMP, TMP or TMPDIR env vars (whichever is found first in their respective order)
              - if the working_dir cannot be set, this function will fail.

  odbInitPtr  - reserved param, its elements are: ExecPath, argc, argv

              - ExecPath: the executable path
              - argc:     number of additional arguments
              - argv:     list of additional arguments. The possible additional args are:
                           -dbg                          enable debugging
                           -nolog                        disable log file
                           -keep_tmpfiles                keep intermmediate files
                           -non_std                      evaluate system defined attr
                           -show_progress                enable progress dialog during open
                           -thrnum:<thrnum_int_val>      set the max num of threads
                           -nocopyin                     do not make a copy of the odb
                                                         hierarchy in the working dir.
                                                         only valid if the input is already
                                                         in directory/file format.

Return

0 if successful and 1 if failed




convertODBInput

Description

Converts the ODB and creates a file for each of the step/layerlist combination. This is the main function for the ODB2GDS library and it accepts a large number of arguments.

Syntax

int ACS_convertODBInput(
                              char * stepName, 
                              char ** layerList, 
                              int layernum, 
                              char * outputName, 
                              int argc, 
                              char ** argv
                             );

Arguments

For more details on what these arguments control, see the Arguments page ....

  stepName    - step's name 
  layerList   - list of layer names
  layernum    - num of layers
  outputName  - output directory (not filename)
  argc        - number of additional arguments

  argv        - list of additional arguments. The possible additional args are:

              output formats
              -gbr[:<gbr filename>]                    gbr output (default)
              -gds[:<gds filename>]                    gds output (not working as advertised)
              -oas[:<oas filename>]                    oas output
              -mic[:<mic filename>]                    mic output

              Specific to GBR Output
              -format:<fmt_dbl_val>                    set the Gerber output format (N.M)
              -odb_symbols                             keep the user defined symbols as a macro

              Specific to GDSII Output
              -gds_layer:<layer_int_val>               set GDSII layer output
              -gds_struct:<struct_name>                set GDSII top structure (default=TOP)


              Specific to MIC Output
              -usegbrflow                              flow (odb->gbr->mic)
              -circular                                set circular mode (only mic output)
              -keepzerow                               if set, zero width paths are passed

              Specific to OASIS
              -oas_modal                               set OASIS modal coordinates on
              -oas_sort                                set OASIS sort output by X,Y position
              -oas_grid:<grid_dbl_val>                 set OASIS grid (default=0.001)
              -oas_cell:<cell_name>                    set OASIS output TOP cell name
              -oas_tile:<x,y>                          set OASIS tile (double val) size
              -oas_top2bot                             OASIS top2bottom option on (sorting rule)
              -oas_angle:<0 | 90 | 180 | 270>          set OASIS angle
              -oas_mirror:<none | x | y>               set OASIS mirror
              -oas_trans:<none | auto>                 set OASIS translate none or auto
              -oas_trans:<explicit>,<x,y>              set OASIS explicit (double val)
              -oas_arg:<other oasis args>              set OASIS other arguments


              Transformation, Units and Clipping
              

              -window:<minx,miny,maxx,maxy>            set window clip (GDSII, OASIS, RIP only)

              -unit:<mils|inch|um|mm|cm>               set the output unit  
                                                       (GBR: inch/mm only;does not apply to MIC)
              
              -scale:<cale_dbl_val>                    set the scale of conversion [default=1]
              -arcres:<res_dbl_val>                    set the arcres of conversion
              -arcsag:<sag_dbl_val>                    set the arcsag of conversion
              
              
              -butting                                 enable butting edge instead of cutline
                                                      ( applies to all output formats)

              -step_repeat                             enable step repeat on the files
                                                       one level deep (check if this applies
                                                       to all output formats.)

              Convienence

              -exclude:<stepnames>                     set steps to be excluded (typical use:
                                                       output a parent Step but not its children.)

              -excludel:<layernames>                   set layers to be excluded (convenience 
                                                       function so that you can select all 
                                                       layers (by not specifyling layer list) 
                                                       and then just excluding a few. 

              -show_progress                           enable progress dialog during conversion


              genesis emulation instructions

              -g2k_ver:<0 | 1 | 2 | 3>                 set genesis emulation version
              -g2k_order:<0 | 1>                       set translation order
              -g2k_break_sr:<0 | 1 | 2>                set break SR on or off
              -g2k_scale_mode:<1 | 2 | 3>              set scaling mode
              -g2k_anchor:<0 | 1 | 2 | 3>              set anchor mode
              -g2k_inch_anchor:<x,y>                   set anchor inch value (double val)
              -g2k_mm_anchor:<x,y>                     set anchor mm value (double val)
              -g2k_offset:<0 | 1 | 2 | 3 | 4 | 5>      set offset mode
              -g2k_inch_offset:<x,y>                   set offset inch value (double val)
              -g2k_mm_offset:<x,y>                     set offset mm value (double val) 


  
              Special Behavior and Custom Output (normally not used)

                                                       special function to output ascii 
              -attrout:<attrname>,<0|1>                list regarding attrname,
                                                       and convert nonzero pad (default:1)
                                                       
              -plotout                                 output ascii regarding 
                                                       attribute .orbotech_plot_stamp

              -attributeson                            enable attribute output (set by 
                                                       -attrout and -plotout by default)

              -log_dyntxt_info                         output information regarding dynamic
                                                       text into a .dat file

 
              -out_scale:<default | sf |scale | local> scales based on ODB++ out_x_scale
                                                       and out_y_scale attributes.
                                                    
              -njb[:<njb filename>]                    create a NETEX njb file 
                                                       (don't specify full path)

              engargs:<args>                           pass args to odb2gdx; generally only
                                                             for specialized debugging.
 

Note

  if stepName!=NULL && layer!=NULL
      then convertODBInput will convert the specified step/layerlist combination

  if stepName!=NULL && layer==NULL
      then convertODBInput will convert the specified step and all its layers

  if stepName==NULL
      then convertODBInput will return an error
 

Return

0 if successful and 1 if failed




getODBOutputDir

Description

Returns the output directory.

Syntax

char * ACS_getODBOutputDir();

Return

the full path of the output directory or NULL if it failed




getODBWorkingDir

Description

Returns the working directory.

Syntax

char * ACS_getODBWorkingDir();

Return

the full path of the working directory or NULL if it failed




getODBLastErr

Description

Returns the last error encountered or NULL if there is none.

Syntax

char * ACS_getODBLastErr(int * errCode);

Return

errCode will be set to the last encountered error code or 0 if there is none




getODBStepCount

Description

Returns the number of steps in the ODB.

Syntax

int ACS_getODBStepCount();

Return

the number of steps in the ODB or -1 if it failed




getODBStepInfoList

Description

Returns a structure of all the steps in the ODB file.

Syntax

int ACS_getODBStepInfoList(struct ODB_StepInfo  stepList, int * stepCount);

Arguments

          - stepList[0] will be set to the first array element in stepList
          - stepCount will be set to the number of steps in stepList

Return

0 if successful and 1 if failed

Note

stepList must be freed after it is no longer needed




freeODBStepInfoList

Description

Frees the list of all the steps in the ODB allocated by getODBStepInfoList.

Syntax

void ACS_freeODBStepInfoList(struct ODB_StepInfo * stepList, int stepCount);



getODBTopStepListName

Description

Returns the list of the top steps.

Syntax

int ACS_getODBTopStepListName(char +++ topStepList, int * numTopStepList);

Arguments

          - topStepList will be set to the list of the top steps names
          - numTopStepList will be set to the number of top steps

Return

0 if successful and 1 if failed




getODBTopStepListIndex

Description

Returns the list of the top steps.

Syntax

int ACS_getODBTopStepListIndex(int ++ topStepList, int * numTopStepList);

Arguments

          - topStepList will be set to the list of the top steps index
          - numTopStepList will be set to the number of top steps

Return

0 if successful and 1 if failed




getODBMostLikelyTopStepName

Description

Returns the name of the top step based on complexity of its data.

Syntax

char * ACS_getODBMostLikelyTopStepName();

Return

the step name or NULL if it failed




getODBMostLikelyTopStepIndex

Description

Returns the index of the top step.

Syntax

int ACS_getODBMostLikelyTopStepIndex();

Return

the step's index in stepList or -1 if it failed




getODBStepName

Description

Returns the name of the specified step when you pass it the index

Syntax

char * ACS_getODBStepName(int stepIdx);

Arguments

  stepIdx     - step's index in stepList (starts with 0)

Return

the step name or NULL if it failed




getODBStepIndex

Description

Returns the index of the specified step when you pass it the name

Syntax

int ACS_getODBStepIndex(char * stepName);

Arguments

  stepName    - step's name

Return

the step's index in stepList or -1 if it failed




getODBStepNameProfileExtent

Description

Returns the profile's extent of the specified step by name.

Syntax

int ACS_getODBStepNameProfileExtent(char * stepName, double * extent);

Arguments

  stepName   - step's name
             - extent will be set to step's profile extent value 
               (minx,miny,maxx,maxy) 

Return

0 if successful and 1 if failed




getODBStepIdxProfileExtent

Description

Returns the profile's extent of the specified step by index

Syntax

int ACS_getODBStepIdxProfileExtent(int stepIdx, double * extent);

Arguments

  stepIdx     - step's index in stepList (starts with 0)
              - extent will be set to step's profile extent value 
                (minx,miny,maxx,maxy)

Return

Return: 0 if successful and 1 if failed




getODBLayerCount

Description

Returns the number of layers in the ODB (not step dependent)

Syntax

int ACS_getODBLayerCount();

Return

the number of layers in the ODB




getODBLayerInfoList

Description

Returns a list of all the layers in the ODB.

Syntax

int ACS_getODBLayerInfoList
    (struct ODB_LayerInfo ++ layerList, int * layerCount);

Arguments

          - layerList[0] will be set to the first array element in layerList
          - layerCount will be set to the number of layers in layerList

Return

Return: 0 if successful and 1 if failed

Note

layerList must be freed after it is no longer needed




freeODBLayerInfoList

Description

Frees the list of all the layers in the ODB allocated by getODBLayerInfoList.

Syntax

void ACS_freeODBLayerInfoList(struct ODB_LayerInfo * layerList, int layerCount);



getODBLayerName

Description

Returns the name of the specified layer given the index.

Syntax

char * ACS_getODBLayerName(int layerIdx);

Arguments

  layerIdx     - layer's index in layerList (starts with 0)

Return

the layer name or NULL if it failed




getODBLayerIndex

Description

Returns the index of the specified layer given the name.

Syntax

int ACS_getODBLayerIndex(char * layerName);

Arguments

  layerName    - layer's name

Return

the layer's index in layerList or -1 if it failed




getODBOutScale

Description

Returns the out_x_scale and out_y_scale value of the specified step/layer combination. This shows you what might be set in the ODB++ file.

Syntax

int ACS_getODBOutScale(char * stepName, char * layerName, double * x, double * y);

Arguments

 stepName  - step's name
 layerName - layer's name
x          - will be set to layer's out_x_scale value
y          - will be set to layer's out_y_scale value

Return

0 if successful and 1 if failed

Note

x and y will be negative if Break S&R == Y




getODBOutAngle

Description

Returns the out_angle of the specified step/layer combination.

Syntax

int ACS_getODBOutAngle(char * stepName, char * layerName, double * a);

Arguments

 stepName   - step's name
 layerName  - layer's name
 -       a  - will be set to layer's out_angle value
   

Return

0 if successful and 1 if failed

Note

* a will be negative if Break S&R == Y




getODBOutMirror

Description

Fills a character string corresponding to the angle specified step/layer combination

Syntax

int ACS_getODBOutMirror(char * stepName, char * layerName, char m[4]);

Arguments

 stepName  - step's name
 layerName - layer's name
 m         - will be set to Y if yes mirror
           - will be set to N if no mirror

Return

0 if successful and 1 if failed

Note

m will be set to -N or -Y if Break S&R == Y




getODBOutPolarity

Description

Returns a character string corresponding to the specified step/layer's polarity

Syntax

int ACS_getODBOutPolarity(char * stepName, char * layerName, char p[4]);

Arguments

  stepName  - step's name
 layerName - layer's name
 p         - will be set to P if positive polarity
           - will be set to N if negative polarity

Return

0 if successful and 1 if failed

Note

p will be set to -P or -N if Break S&R == Y




getODBProfileInch

Description

Returns profile information for a given step (returns data in inches)

Syntax

int ACS_getODBProfileInch
    (char * stepName,int *numPolys, int **polyVcnt, double ***polyXYdata);

Arguments

 stepName   - stepís name
 numPolys   - will be set to the number of polygons
 polyVcnt   - will be set to the list of vertex counts for each polygons
 polyXYdata - will be set to the list of vertex for each polygons

Return

0 if successful and 1 if failed

Note

one vertex is a pair of x,y coordinates

Example:

	 Vertex Count: polyVcnt[0] = 2
	 Vertex 1: polyXYdata[0][0], polyXYdata[0][1]   (x,y)
	 Vertex 2: polyXYdata[0][2], polyXYdata[0][3]   (x,y)



getODBProfileMM

Description

Returns profile information for a given step (returns data in mm)

Syntax

int ACS_getODBProfileMM
                             ( char * stepName,
                               int *numPolys, 
                               int **polyVcnt, 
                               double ***polyXYdata
                              );

Arguments

 stepName   - stepís name
 numPolys   - will be set to the number of polygons
 polyVcnt   - will be set to the list of vertex counts for each polygons
 polyXYdata - will be set to the list of vertex for each polygons

Return

0 if successful and 1 if failed

Note

one vertex is a pair of x,y coordinates

	 Example:
	 Vertex Count: polyVcnt[0] = 2
	 Vertex 1: polyXYdata[0][0], polyXYdata[0][1]   (x,y)
	 Vertex 2: polyXYdata[0][2], polyXYdata[0][3]   (x,y)



freeODBProfile

Description

Cleanup function for getODBProfile

Syntax

void ACS_freeODBProfile(int numPolys, int *polyVcnt, double ++polyXYdata);

Arguments

 numPolys - pointer to the number of polygons
 polyVcnt - pointer to the list of vertex counts for each polygons
 polyXYdata - pointer to the list of vertex for each polygons



getODBSymbolInfoList

Description

Returns a list of all the user defined symbols in the ODB. (ODB like Gerber custom macros)

Syntax

int ACS_getODBSymbolInfoList(struct ODB_SymbolInfo ++ symbolList, int * symbolCount);

Arguments

- symbolList[0] - will be set to the first array element in symbolList
- symbolCount   - will be set to the number of symbols in symbolList

Return

0 if successful and 1 if failed

Note

symbolList must be freed after it is no longer needed




freeODBSymbolInfoList

Description

Frees the list of all user defined the symbols in the ODB allocated by ACS_getODBSymbolInfoList.

Syntax

void ACS_freeODBSymbolInfoList(struct ODB_SymbolInfo * symbolList, int symbolCount);



printODBTree

Description

Returns a string of the ODB info for the specified step/layerlist combination. This is informational return.

Syntax

char * ACS_printODBTree(
                             char * stepName, 
                             char ** layerList, 
                             int layernum, 
                             int traverse
                             );

Arguments

  stepName    - step's name 
  layerList   - list of layer names
  layernum    - num of layers
  traverse    - 1 if traverse the step-repeat, 0 otherwise
 

Return

a string of the given step's info (and the info of it's children) or NULL if failed

Note

  if stepName!=NULL && layer!=NULL
     then getODBInfo returns info of the specified step/layerlist combination

  if stepName!=NULL && layer==NULL
     then getODBInfo returns info of the specified step and all its layers

  if stepName==NULL
     then getODBInfo returns an error
 

user must free the string it returns




getODBInfo

Description

Returns the ODB info for the specified step/layerlist combination.

Syntax

int ACS_getODBInfo
            (char * stepName, 
             char  layerList, 
             int layernum, 
             struct ODB_StepInfo 
             ** stepInfo
            );

Arguments

  stepName    - step's name 
  layerList   - list of layer names
  layernum    - num of layers
  stepInfo    - will be set to the ODB_StepInfo of the specified step
              - will contain step_index, extent, profile extent and
                a list of ODB_LayerInfo (as specified)
                Each layerInfo in stepInfo will contain layer_name, layer_index, 
                context, type, extent, polarity, startname, endname, addtype, color.

Note

  if stepName!=NULL && layer!=NULL
     then getODBInfo will return info of the specified step/layerlist combination

  if stepName!=NULL && layer==NULL 
     then getODBInfo will return info of the specified step and all its layers

  if stepName==NULL
     then getODBInfo will return an error

stepInfo.Layer_list must be freed after

Return

0 if successful and 1 if failed




freeODBInfo

Description

Frees the step info allocated by getODBInfo.

Syntax

void ACS_freeODBInfo(struct ODB_StepInfo * stepInfo);



ACS_convertODBAttr

Description

Converts the ODB attributes and creates a text file for each of the step/layerlist combination.

Syntax

int ACS_convertODBAttr(
                             char * stepName, 
                             char * layerName, 
                             char * attrlist, 
                             char * outputName, 
                             int argc, 
                             char ** argv
                            );

Arguments

  stepName    - step's name 
  layerName   - layer's names
  attrlist    - list of attributes separated by semicolon (;)
  outputName  - attribute output file name
  argc        - number of additional arguments
  argv        - list of additional arguments. The possible additional args are:

              -g2k_ver:<0 | 1 | 2 | 3>                 set genesis emulation version
              -g2k_order:<0 | 1>                       set translation order
              -g2k_break_sr:<0 | 1 | 2>                set break SR on or off
              -g2k_scale_mode:<1 | 2 | 3>              set scaling mode
              -g2k_anchor:<0 | 1 | 2 | 3>              set anchor mode
              -g2k_inch_anchor:<x,y>                   set anchor inch value (double val)
              -g2k_mm_anchor:<x,y>                     set anchor mm value (double val)
              -g2k_offset:<0 | 1 | 2 | 3 | 4 | 5>      set offset mode
              -g2k_inch_offset:<x,y>                   set offset inch value (double val)
              -g2k_mm_offset:<x,y>                     set offset mm value (double val)
              
              -unit:<inch|mm>                          set the unit of conversion
              -scale:<scale_dbl_val>                   set the scale of conversion
              -arcres:<res_dbl_val>                    set the arcres of conversion
              -arcsag:<sag_dbl_val>                    set the arcsag of conversion
              -out_scale:<default | sf |scale | local> set the out_scale mode of conversion
 

Note

if stepName==NULL || layer==NULL - convertODBInput will return an error

Return

0 if successful and 1 if failed




createODBOutputAttr

Description

Converts the ODB and creates an attribute file for the step/layer combination.

Syntax

int ACS_createODBOutputAttr(
                                  char * stepName, 
                                  char * layerName, 
                                  char * outName, 
                                  char * attrName, 
                                  int cvtnonzero, 
                                  int outcoor
                                );

Arguments

  stepName    - step's name 
  layerName   - layer's name 
  outputName  - output file name
  attrName    - attribute to extract
  cvtnonzero  - 1 convert non zero pad, 0 do not convert non zero pad 
                (used in conjunction with outcoor == 1)
  outcoor     - 1 output final coordinate; 0 do not output GBR/final coordinate
                (if 1 ACS_convertODBInput must be called beforehand 
                with the argument -attributeson, else ACS_openODB must be called first)

Note

if stepName==NULL || layer==NULL - createODBOutputAttr will return an error

Return

Return: 0 if successful and 1 if failed




createODBOutputPlot

Description

Converts the ODB and creates a plot file for the step/layer combination.

Syntax

int ACS_createODBOutputPlot(
                                char * stepName, 
                                char * layerName, 
                                char * outName, 
                                int outcoor);

Arguments

  stepName    - step's name 
  layerName   - layer's name 
  outputName  - output file name
  outcoor     - 1 output final coordinate, 0 do not output GBR/final coordinate
               (if 1 ACS_convertODBInput must be called first with argument -attributeson, 
                else ACS_openODB must be called beforehand)

Note

if stepName==NULL || layer==NULL createODBOutputPlot will return an error

Return

Return: 0 if successful and 1 if failed




createODBOutputDynTxt

Description

Creates a dynamic text file for the step/layer combination.

Syntax

int ACS_createODBOutputDynTxt(char * stepName, char * layerName, char * outName);

Arguments

  stepName    - step's name 
  layerName   - layer's name 
  outputName  - output file name

Note

if stepName==NULL || layer==NULL createODBOutputDynTxt will return an error

Return

0 if successful and 1 if failed




ACS_setODBArcres

Description

Sets the Arc Resolution for the final output files. This can also be set in the arguments of ACS_ConvertODBInput

Syntax

void ACS_setODBArcres(double arcres);

Arguments

  arcres      - new arc resolution     



ACS_setODBArcsag

Description

Sets the Arc Sag for the final output files. This can also be set in the arguments of ACS_ConvertODBInput

Syntax

void ACS_setODBArcsag(double arcsag);

Arguments

  arcsag      - new arc sag    



ACS_getODBVersion

Description

Gets the version number of the DLL and returns the version

Syntax

char * ACS_getODBVersion();



ACS_getODBRcs

Description

Gets the rcs number of the DLL and returns the rcs

Syntax

char * ACS_getODBRcs();



ACS_getODBDate

Description

Gets the date of the DLL and returns the date

Syntax

char * ACS_getODBDate();



setParentDlg

Description

Sets the parent dialog for the progress dialog. Not needed for Linux or Unix implementations.

Syntax

#if(!defined(_WinNT_))
void ACS_setParentDlg(void *pt);
#endif



closeODB

Description

Closes the ODB internal database and cleans up

Syntax

int ACS_closeODB();

Return

Return: 0 if successful and 1 if failed




getODBInfo

Description

Returns the ODB job info (from the /misc/info or /misc/job files

Syntax

void ACS_getODBJobInfo(struct ODB_JobInfo * jobInfo);

Arguments

jobInfo will be set to the ODB_JobInfo

Return

Return: 0 if successful and 1 if failed




Download Revision History Program Usage Library Price





ARTWORK CONVERSION SOFTWARE, INC.                  Company Profile
417 Ingalls St.,     Santa Cruz, CA 95060         Tel (831) 426-6163     Fax 426-2824               email: info@artwork.com