[Artwork] / [QisMLib] / [Programmer's Corner]
Refer to QisMScript Commands page for syntax details
Sample Scripts (using QisMScript)QisMFilePrint scan information from a CAD fileCreate DBLOAD cache (disk image) from a GDSII fileQisMExploderExplode polygons (boundaries) from a view of a CAD file - write as OASISExplode polygons (boundaries) from a view of a CAD file - write as TIFF imageExplode TEXTs from a view of a CAD fileExplode references from a view of a CAD fileQisMBoolUnionize polygons from a view of a CAD filePerform binary operation between polygons of two layers from a CAD fileQisMDrawRender a view of a CAD file to a GIF imageQisMLayerSynthSynthesize a layer from an expression of boolean operations between layers of a CAD fileQisMClipExtractExtract clips of polygons from various windows of a CAD fileExtract clips of raster bitmaps from various windows of a CAD fileQisMRasterGenerate high resolution raster bitmaps from a set of windows of a CAD fileQisMRTCR (Windows)Generate high resolution raster bitmaps with corrections and annotationsQisMCorrXApply multi-point corrections to a view of a CAD fileGenerate a raster image from a corrected view of a CAD fileQisMHExtractExtract data with hierarchy from a CAD fileCombine three CAD files into oneQisMGerber (Windows)Create a GDSII file from Gerber inputUse QisMClipExtract (images) with Gerber input
xxxxxxxxxx
## fileinfo.script: print scan information from a file
## required license: 11003 (QisMLib)
# Ensure that the input file is specified
script.required INPUT
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Print names of all cells with extents
file.print_cells $filedb=F1 extents
# Print hierarchy tree for each top cell
file.print_cell_tree $filedb=F1
# Print list of layer:datatype(s)
file.print_layers $filedb=F1
# Destroy database
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute fileinfo.script on the command-line
qismscript64.exe
+script:fileinfo.script
-log:fileinfo.log
INPUT=${gds_oas_dbload_file_path}
xxxxxxxxxx
## dbload.script: create dbload cache from a gdsii database
## required license: 11003 (QisMLib)
# Ensure user input is present
script.required GDSII
# Create database from a GDSII file
lib.load_file &filedb=F1 "input=((GDSII))" "layermap=((LAYERMAP))" ((NOTEXT))
# Save database to DBLOAD
file.save_memory_maps $filedb=F1
# Cleanup
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute dbload.script on the command-line
qismscript64.exe
+script:dbload.script
-log:dbload.log
GDSII=${gds_file_path}
[LAYERMAP=${layer_mapping_scheme}]
[NOTEXT=notext]
xxxxxxxxxx
## explode_to_oas.script : write geometries from a view of a database to an oasis file
## required license: 11003 (QisMLib) 11027 (QisMExploder)
# Ensure that the input file, window and output path are specified
script.required INPUT WINDOW OUTBASE
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Create exploder object
file.create_exploder $filedb=F1 &exploder=E1
# Set a view to explode (default cell, all layers, all nesting levels)
exploder.set_view $exploder=E1 "window=((WINDOW))"
# Collect polygons (boundaries and paths) crossing that view
exploder.get_boundaries $exploder=E1 &bin=B1
# Write polygons to an OASIS file with nm resolution
store.write_as_polys $bin=B1 "path=((OUTBASE))" grid=1e-9 units=1e-6 format=OAS
# Destroy collected polygons
exploder.delete_store $bin=B1
# Destroy exploder object
file.destroy_exploder $filedb=F1 $exploder=E1
# Destroy database
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute explode_to_oas.script on the command-line
qismscript64.exe
+script:explode_to_oas.script
-log:explode_to_oas.log
INPUT=${gds_oas_dbload_file_path}
WINDOW=${minx},${miny},${maxx},${maxy}
OUTBASE=${output_oas_dir_and_filename}
xxxxxxxxxx
## explode_to_tif.script: write geometries from a view of a database to an tiff image
## required license: 11003 (QisMLib) 11027 (QisMExploder) 14827 (QisMRaster)
## required extension: QisMRaster
# Ensure user input is present
script.required INPUT LAYER WINDOW OUTBASE DPI
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Create exploder object
file.create_exploder $filedb=F1 &exploder=E1
# Set a view to explode (default cell, all nesting levels)
exploder.set_view $exploder=E1 "window=((WINDOW))" "layers_on=((LAYER))"
# Collect polygons (boundaries and paths) crossing that view
exploder.get_boundaries $exploder=E1 &bin=B1
# Write polygons to a TIF file with 0.5um resolution
store.write_as_image $bin=B1 "path=((OUTBASE))" grid=1e-9 units=1e-6 format=TIF resolution=DPI,((DPI))
# Destroy collected polygons
exploder.delete_store $bin=B1
# Destroy exploder object
file.destroy_exploder $filedb=F1 $exploder=E1
# Destroy database
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute explode_to_tif.script on the command-line
qismscript64.exe
+script:explode_to_tif.script
-log:explode_to_tif.log
INPUT=${gds_oas_dbload_file_path}
LAYER=${layers_string}
WINDOW=${minx},${miny},${maxx},${maxy}
OUTBASE=${output_tif_dir_and_filename}
DPI=${dots_per_inch}
xxxxxxxxxx
## explode_texts.script: write TEXTs from a view of a database to a text file
## required license: 11003 (QisMLib) 11027 (QisMExploder)
# Ensure user input is present
script.required INPUT OUTPUT
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Create exploder object
file.create_exploder $filedb=F1 &exploder=E1
# Collect texts and write to file (with sorting)
exploder.write_texts_to_file $exploder=E1 "file=((OUTPUT))" sort
# Destroy exploder object
file.destroy_exploder $filedb=F1 $exploder=E1
# Destroy database
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute explode_texts.script on the command-line
qismscript64.exe
+script:explode_texts.script
-log:explode_texts.log
INPUT=${gds_oas_dbload_file_path}
OUTPUT=${output_txt_file_path}
xxxxxxxxxx
## explode_refs.script : write cell references from a view of a database to a text file
## required license: 11003 (QisMLib) 11027 (QisMExploder)
# Ensure user input is present
script.required INPUT OUTBASE WINDOW
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Create exploder object
file.create_exploder $filedb=F1 &exploder=E1
# Set a view to explode (default cell, all layers, all nesting levels)
exploder.set_view $exploder=E1 "window=((WINDOW))"
# Collect srefs and write to file (with sorting)
exploder.write_srefs_to_file $exploder=E1 "file=((OUTBASE)).srefs" sort
# Collect arefs and write to file (with sorting)
exploder.write_arefs_to_file $exploder=E1 "file=((OUTBASE)).arefs" sort
# Destroy exploder object
file.destroy_exploder $filedb=F1 $exploder=E1
# Destroy database
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute explode_refs.script on the command-line
qismscript64.exe
+script:explode_refs.script
-log:explode_refs.log
INPUT=${gds_oas_dbload_file_path}
OUTBASE=${output_srefs_arefs_dir_and_filename}
WINDOW=${minx},${miny},${maxx},${maxy}
xxxxxxxxxx
## unary.script: perform boolean operation on polygons from a window
## required license: 11003 (QisMLib), 11047 (QisMBool)
## set some default parameters
script.setif FORMAT=GDS WLAYER=500:500 OLAYER=100:0 OUTPUT=out.sf
## ensure that the required parameters have been specified
script.required INPUT WINDOW LAYERS OUTPUT
## load the input GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F input=((INPUT))
## create an output GDSII file
cadwriter.open &writer=W grid_m=((F.grid)) units_m=((F.units)) path=((OUTPUT)) format=((FORMAT))
cadwriter.begin_cell $writer=W name=TOP
## write the extents of the window of interest to the output file
cadwriter.box $writer=W box=((WINDOW)) layer=((WLAYER))
## create a boolean object
bool.create_instance &bool=B
## create and setup a boolean settings object
bool.create_settings &settings=S
boolsettings.set $settings=S grid=((F.grid)) units=((F.units)) clip=((WINDOW)) sliver=((SLIVER)) butting=((OVERLAP)) maxvert=((MAXV)) passthru=((PASS)) mergestripes=((MERGE)) convex=((CONVEX)) sizing=((SIZING)) rndcorners=((RNDCORNERS))
## get polygons crossing the specified view
file.create_exploder &exploder=E $filedb=F
exploder.set_view $exploder=E layers_on=((LAYERS)) window=((WINDOW))
exploder.get_boundaries $exploder=E &bin=B1
## write source polygons to the output file as-is
cadwriter.bstore $writer=W $bin=B1
## perform boolean operation on the source polygons
boolinst.union $bool=B $in=B1 &out=Bu $settings=S layer=((OLAYER))
## write resulting polygons to the output file
cadwriter.bstore $writer=W $bin=Bu
## cleanup
boolinst.delete_store $bin=Bu
exploder.delete_store $bin=B1
file.destroy_exploder $exploder=E $filedb=F
bool.destroy_settings $settings=S
bool.destroy_instance $bool=B
cadwriter.end_cell $writer=W
cadwriter.close $writer=W
lib.unload_file $filedb=F
script.print_vars
xxxxxxxxxx
## execute unary.script on the command-line
qismscript64.exe
+script:unary.script
-log:unary.log
INPUT=${gds_oas_dbload_file_path}
WINDOW=${minx},${miny},${maxx},${maxy}
LAYERS=${layers_to_unionize}
OUTPUT=${output_gds_oas_dir_and_filename}
[FORMAT=GDS | FORMAT=OAS]
[SLIVER=${sliver_threshold}]
[OVERLAP=${overlap_between_butting_polygons}]
[MAXV=${max_vertices_per_output_polygon}]
[PASS=ON | PASS=OFF]
[MERGE=ON | MERGE=OFF]
[CONVEX=OFF | CONVEX=FULL | CONVEX=HTRAP | CONVEX=VTRAP]
[SIZING=OFF | SIZING=STD | SIZING=ISOTR,${value} | SIZING=NONISOTR,{x_value},{y_value}]
[RNDCORNERS=RTANGLE | RNDCORNERS=THREEPT | RNDCORNERS=FIVEPT]
xxxxxxxxxx
## binary.script: perform boolean operation between polygons from two layers for a window
## required license: 11003 (QisMLib), 11047 (QisMBool)
## set some default parameters
script.setif FORMAT=GDS WLAYER=500:500 OLAYER=100:0 OUTPUT=out.sf
## ensure that the required parameters have been specified
script.required INPUT WINDOW L1 L2 OP OUTPUT
## load the input GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F input=((INPUT))
## create an output GDSII file
cadwriter.open &writer=W grid_m=((F.grid)) units_m=((F.units)) path=((OUTPUT)) format=((FORMAT))
cadwriter.begin_cell $writer=W name=TOP
## write the extents of the window of interest to the output file
cadwriter.box $writer=W box=((WINDOW)) layer=((WLAYER))
## create a boolean object
bool.create_instance &bool=B
## create and setup a boolean settings object
bool.create_settings &settings=S
boolsettings.set $settings=S grid=((F.grid)) units=((F.units)) clip=((WINDOW)) sliver=((SLIVER)) butting=((OVERLAP)) maxvert=((MAXV)) passthru=((PASS)) mergestripes=((MERGE)) convex=((CONVEX)) sizing=((SIZING)) rndcorners=((RNDCORNERS))
## get polygons crossing the specified view for operands A & B
file.create_exploder &exploder=E $filedb=F
exploder.set_view $exploder=E layers_on=((L1)) window=((WINDOW))
exploder.get_boundaries $exploder=E &bin=B1
exploder.set_view $exploder=E layers_on=((L2)) window=((WINDOW))
exploder.get_boundaries $exploder=E &bin=B2
## write source polygons to the output file as-is
cadwriter.bstore $writer=W $bin=B1
cadwriter.bstore $writer=W $bin=B2
## perform boolean operation on the source polygons
boolinst.binary $bool=B $bin_a=B1 $bin_b=B2 &out=Bu $settings=S layer=((OLAYER)) op=((OP))
## write resulting polygons to the output file
cadwriter.bstore $writer=W $bin=Bu
## cleanup
boolinst.delete_store $bin=Bu
exploder.delete_store $bin=B1
exploder.delete_store $bin=B2
file.destroy_exploder $exploder=E $filedb=F
bool.destroy_settings $settings=S
bool.destroy_instance $bool=B
cadwriter.end_cell $writer=W
cadwriter.close $writer=W
lib.unload_file $filedb=F
script.print_vars
xxxxxxxxxx
## execute binary.script on the command-line
qismscript64.exe
+script:binary.script
-log:binary.log
INPUT=${gds_oas_dbload_file_path}
WINDOW=${minx},${miny},${maxx},${maxy}
L1=${layer1}[:{datatype1}]
L2=${layer2}[:${datatype2}]
OP=UNION | OP=DIFFERENCE | OP=INTERSECTION | OP=XOR
[FORMAT=GDS | FORMAT=OAS]
[SLIVER=${sliver_threshold}]
[OVERLAP=${overlap_between_butting_polygons}]
[MAXV=${max_vertices_per_output_polygon}]
[PASS=ON | PASS=OFF]
[MERGE=ON | MERGE=OFF]
[CONVEX=OFF | CONVEX=FULL | CONVEX=HTRAP | CONVEX=VTRAP]
[SIZING=OFF | SIZING=STD | SIZING=ISOTR,${value} | SIZING=NONISOTR,{x_value},{y_value}]
[RNDCORNERS=RTANGLE | RNDCORNERS=THREEPT | RNDCORNERS=FIVEPT]
xxxxxxxxxx
## draw.script : render a view of the database to a gif image
## requires license : 11003 (QisMLib)
## ensure the user arguments have been specified
script.required INPUT BASE
## create a database from a gdsii/oasis file
lib.load_file &filedb=F "input=((INPUT))"
## create a gif image from a view of the database
draw.image $filedb=F "path=((BASE))" cell=((CELLNAME)) layers=((LAYERS)) window=((WINDOW)) nesting=((NL)) filtersize=((DFS)) res=((RES)) text=((TEXT)) background=((BCKG)) fill=((FILL)) refboxes=((REFS))
## destroy the database
lib.unload_file $filedb=F
xxxxxxxxxx
## execute draw.script on the command-line
qismscript64.exe
+script:draw.script
-log:draw.log
INPUT=${gds_oas_dbload_file_path}
BASE=${output_gif_dir_and_filename}
[CELLNAME={view_cell}]
[LAYERS={layers_string}]
[WINDOW=${minx},${miny},${maxx},${maxy}]
[NL=${nesting_level}]
[DFS=${display_filter_size}]
[RES=${x_pixels},{y_pixels}]
[TEXT=ON | TEXT=OFF]
[BCKG=BLACK | BCKG=WHITE]
[FILL=ON | FILL=OFF]
[REFS=ON | REFS=OFF | REFS=NL]
xxxxxxxxxx
## lsynth.script: synthesize a layer using an expression (e.g Lout = L1 - L2) of layers and boolean operators from a view of a database
## required license: 11003 (QisMLib) 11069 (QisMLayerSynth)
## required extension: QisMLayerSynth
# Ensure user input is present
script.required INPUT WINDOW LY1 LY2 LOUT
# Create database from a GDSII/OASIS/DBLOAD file
lib.load_file &filedb=F1 "input=((INPUT))"
# Create synthesizer object
lsynth.new_synthesizer &lsynth=L1 $filedb=F1
# Perform layer synthesis (LOUT = LY1 - LY2)
lsynth.synthesize_layers $lsynth=L1 &bin=B1 "spec=@ ((LY1)) ((LY2)) - ((LOUT)) ~" clip "window=((WINDOW))"
# Write output layer to a GDSII file
store.write_as_polys $bin=B1 path=./lsynth grid=1e-9 units=1e-6 format=GDS
# Cleanup
lsynth.delete_store $bin=B1
lsynth.delete_synthesizer $lsynth=L1
lib.unload_file $filedb=F1
xxxxxxxxxx
## execute lsynth.script on the command-line
qismscript64.exe
+script:lsynth.script
-log:lsynth.log
INPUT=${gds_oas_dbload_file_path}
WINDOW=${minx},${miny},${maxx},${maxy}
LY1=${layer1}[:{datatype1}]
LY2=${layer2}[:{datatype2}]
LOUT=${output_layer}:${output_datatype}
xxxxxxxxxx
## clipx.script : extract clips (windows) of a database as gdsii files
## required license: 11003 (QisMLib), 4 x 31209 (QisMClipExtract)
## required extension: QisMClipExtract
## ensure required user inputs have been specified
script.required INPUT WIDTH HEIGHT DIRNAME
## make output directory
system mkdir "((DIRNAME))"
## create database from a GDSII/OASIS design
lib.load_file &filedb=F "input=((INPUT))"
## create a set of 20 random windows of the specified WIDTH x HEIGHT
file.get_cell_extents $filedb=F &var=HOME
script.new_window_set &set=W "rand=((DIRNAME))/clips:((HOME)):((WIDTH)),((HEIGHT)):20"
## extract clips of polygons as OASIS files
clip.extract_polygons $filedb=F $windows=W clip format=OAS per_layer_union thrnum=4,1
## cleanup before exit
script.delete_window_set $set=W
lib.unload_file $filedb=F
xxxxxxxxxx
## execute clipx.script on the command-line
qismscript64.exe
+script:clipx.script
-log:clipx.log
INPUT=${gds_oas_dbload_file_path}
WIDTH=${clip_width_fileunits}
HEIGHT=${clip_height_fileunits}
DIRNAME=${output_dir}
xxxxxxxxxx
## clipx_img.script : extract clips (windows) of a database as image files
## required license: 11003 (QisMLib), 4 x 31209 (QisMClipExtract)
## required extension: QisMClipExtract
## ensure required user inputs have been specified
script.required INPUT WIDTH HEIGHT DIRNAME LAYERS DPI
## make output directory
system mkdir "((DIRNAME))"
## create database from a GDSII/OASIS design
lib.load_file &filedb=F "input=((INPUT))"
## create a set of 20 random windows of the specified WIDTH x HEIGHT
file.get_cell_extents $filedb=F &var=HOME
script.new_window_set &set=W "rand=((DIRNAME))/clips:((HOME)):((WIDTH)),((HEIGHT)):20"
## extract clips of polygons as TIFF files
clip.extract_images $filedb=F $windows=W resolution=DPI,((DPI)) layers=((LAYERS)) format=TIF
## cleanup before exit
script.delete_window_set $set=W
lib.unload_file $filedb=F
xxxxxxxxxx
## execute clipx_img.script on the command-line
qismscript64.exe
+script:clipx_img.script
-log:clipx_img.log
INPUT=${gds_oas_dbload_file_path}
DIRNAME=${output_dir}
WIDTH=${clip_width_fileunits}
HEIGHT=${clip_height_fileunits}
DPI=${dots_per_inch}
LAYERS=${layers_string}
xxxxxxxxxx
## qismrip.script: generate high-res raster bitmaps for a set of windows from a database
## required license: 11003 (QisMLib), 14827 (QisMRaster)
## required extension: QisMRaster
## ensure required user inputs have been specified
script.required INPUT OUTBASE NXY PXSIZE
## create a db from a file
lib.load_file &filedb=FDB "input=((INPUT))" layermap=((LAYERMAP)) notext
## create a set of nx*ny equal sized tiles from the home view
file.get_cell_extents $filedb=FDB &var=HOME
script.new_window_set &set=WNDS "tilerc=((OUTBASE)):((HOME)):((NXY))"
## create rasterization parameters
raster.create_params ¶ms=ROPTS pixelsize=((PXSIZE)) ((INVERT)) ((DITHER)) ((R2L)) ((B2T)) thrnum=((NTHREADS)) format=TIF
## create rasterizer
raster.create_rasterizer &rstr=RSTR $filedb=FDB
## rasterize windows
raster.window $rstr=RSTR $windows=WNDS $params=ROPTS cell=((CELL)) layers=((LAYERS))
## cleanup before exit
raster.destroy_rasterizer $rstr=RSTR
raster.destroy_params $params=ROPTS
script.delete_window_set $set=WNDS
lib.unload_file $filedb=FDB
script.print_vars
xxxxxxxxxx
## execute qismrip.script from the command-line
qismscript64.exe
+script:qismrip.script
-log:qismrip.log
INPUT=${gds_oas_dbload_file_path}
OUTBASE=${output_dir_and_filename}
NXY=${n_tiles_x},${n_tiles_y}
PXSIZE=${size_x}[,${size_y}]
[NTHREADS={n_threads_per_image}]
[LAYERS=${layers_string}]
x
## rtcr.script
## requires license: 11003 (QisMLib) 1303 (QisMRTCR) 14827 (QisMRaster)
## requires extension: QisMRTCR QisMRaster
## Create job directory
system rd /s /q JOB1
system md JOB1
## Create corrections object if the corrections file is specified
script.if CORRFILE rtcr.create_corrections &corr=CORR1 "file=((CORRFILE))"
## Create annotations object if the annotations file is specified
script.if ANNFILE rtcr.create_annotations &ann=ANN1 "file=((ANNFILE))"
## Setup job
askif key=INPUT "msg=Specify the semi-flat GDSII input created by SFGen"
rtcr.setup_job &job=JOB1 outdir=JOB1 "input=((INPUT))" $ann=ANN1 $corr=CORR1
## Create a set of 6x6 tiles from the home view
file.get_cell_extents $filedb=JOB1 &var=HOME
script.new_window_set &set=WNDS1 "tilerc=tile:((HOME)):6,6"
## Create rasterizer
askif key=PXSIZE "msg=Specify the size of each pixel {x}[,{y}]"
rtcrjob.create_rasterizer $job=JOB1 &rstr=RSTR1 pixelsize=((PXSIZE))
## Get raster images for the specified tiles as TIFF files
rtcrjob.get_raster_image $job=JOB1 $rstr=RSTR1 $windows=WNDS1 format=TIF
## Cleanup
script.delete_window_set $set=WNDS1
rtcrjob.destroy_rasterizer $job=JOB1 $rstr=RSTR1
rtcr.end_job $job=JOB1
rtcr.destroy_corrections $corr=CORR1
rtcr.destroy_annotations $ann=ANN1
xxxxxxxxxx
## execute rtcr.script
qismscript64.exe
+script:rtcr.script
-log:rtcr.log
INPUT=${sfgen_semiflat_gdsii_output_path}
PXSIZE=${sizeof_pixel_x}[,{sizeof_pixel_y}]
[CORRFILE=${corrections_txt_file_path}]
[ANNFILE=${annotations_txt_file_path}]
xxxxxxxxxx
## corrx.script : apply corrections to a view of the database
## requires license : 11003 (QisMLib) 11093 (QisMCorrX)
## requires extension : QisMCorrX
## set default options
script.setif NT=0 SOURCE=100
## ensure required arguments have been specified
script.required INPUT CORRECTIONS WINDOW BASE
## create database from a gdsii/oasis file
lib.load_file &filedb=F input=((INPUT))
## create correction options
corrx.create_opts &opts=O thrnum=((NT)) source=((SOURCE))
## create correction object
corrx.create_corrx_obj &corrx=C $filedb=F corrections=((CORRECTIONS)) cell=((CELL))
## generate corrected geometries from a view of the database
corrxobj.correct_view $corrx=C window=((WINDOW)) &bin=B $opts=O layers=((LAYERS))
## write corrected geometries to a gdsii file
store.write_as_polys $bin=B path=((BASE)) grid=((F.grid)) units=((F.units)) format=GDS
## cleanup
corrx.destroy_corrx_obj $corrx=C
corrxobj.delete_store $bin=B
corrx.destroy_opts $opts=O
lib.unload_file $filedb=F
script.print_vars
xxxxxxxxxx
## execute corrx.script on the command-line
qismscript64.exe
+script:corrx.script
-log:corrx.log
INPUT=${gds_oas_dbload_file_path}
WINDOW=${minx},${miny},${maxx},${maxy}
BASE=${output_gds_dir_and_filename}
CORRECTIONS=${x},${y},${dx},${dy}[,${x},${y},${dx},${dy}]*
[LAYERS=${layers_string}]
xxxxxxxxxx
## corrx_raster.script : apply corrections (as simple rotation) to a view of the database and generate raster image
## requires license : 11003 (QisMLib) 11093 (QisMCorrX) 14827 (QisMRaster)
## requires extension : QisMCorrX QisMRaster
## set default options
script.setif NT=0 ANGLE=20 FORMAT=TIF
## ensure required arguments have been specified
script.required INPUT WINDOW PXS
## create database from a gdsii/oasis file
lib.load_file &filedb=F input=((INPUT))
## create correction options
corrx.create_opts &opts=O thrnum=((NT))
## compute correction points from a standard rotation
corrx.rotate_view $filedb=F angle=((ANGLE)) cell=((CELL)) &var=CORRECTIONS
## create rasterization parameters
raster.create_params ¶ms=P pixelsize=((PXS)) ((INVERT)) dither=((DITHER)) ((R2L)) ((B2T)) thrnum=((NT)) format=((FORMAT))
## create rasterizer object
raster.create_rasterizer &rstr=R $filedb=F
## create corrections object
corrx.create_corrx_obj &corrx=C $filedb=F corrections=((CORRECTIONS)) cell=((CELL))
## generate raster image for a window
corrxobj.rasterize_window $corrx=C $rstr=R $params=P window=((WINDOW)) layers=((LAYERS))
## cleanup
corrx.destroy_corrx_obj $corrx=C
raster.destroy_rasterizer $rstr=R
raster.destroy_params $params=P
corrx.destroy_opts $opts=O
lib.unload_file $filedb=F
script.print_vars
xxxxxxxxxx
## execute corrx_raster.script on the command-line
qismscript64.exe
+script:corrx_raster.script
-log:corrx_raster.log
INPUT=${gds_oas_dbload_file_path}
ANGLE=${correction_angle_degrees}
PXS=${size_of_pixel_x}[,${size_of_pixel_y}]
LAYERS=${layers_string}
WINDOW=${minx},${miny},${maxx},${maxy}
xxxxxxxxxx
## hextract.script: extract hierarchical data from a view of the file
## required license: 11003 (QisMLib), 11083 (QisMHExtract)
## required extension: QisMHExtract
## load the source file
askif key=INPUT "msg=Specify path of the input file"
lib.load_file &filedb=F input=((INPUT))
## create the extractor object
hextract.create_extractor &extractor=H $filedb=F
## create a circular clipping region
hextract.create_regions ®ions=R ((COMPLEMENT))
askif key=CIRC "msg=Specify circle as {cx},{cy},{radius},{arcres},{arcsag}"
hextractregions.add $regions=R circle=((CIRC))
## create a settings object
hextract.create_opts &opts=O ((FLATTEN)) ((TEXT)) ((NOPATHS)) sliver=((SLIVER)) top=((TOPNAME)) prename=((PRE)) postname=((POST)) layeroffx=((LOFFX)) clip=((CLIP)) txy=((TXY)) scale=((SCALE)) angle=((ANGLE)) onlyrefs=((ONLYREFS)) droprefs=((DROPREFS))
## create extracted output
askif key=OUT "msg=Specify base path of the output file"
hextractor.extract_to_file $extractor=H out=((OUT)) units=((F.grid)),((F.units)) format=((FORMAT)) cell=((CELL)) layers=((LAYERS)) $opts=O $regions=R
## cleanup
hextract.destroy_opts $opts=O
hextract.destroy_regions $regions=R
hextract.destroy_extractor $extractor=H
lib.unload_file $filedb=F
script.print_vars
xxxxxxxxxx
## execute hextract.script on the command-line
qismscript64.exe
+script:hextract.script
-log:hextract.log
INPUT=${gds_oas_dbload_file_path}
CIRC=${center_x},${center_y},${radius},${arcres},${arcsag}
[COMPLEMENT=complement]
[TEXT=text]
[NOPATHS=nopaths]
[PRE=${output_cellnames_prefix}]
[POST=${output_cellnames_suffix}]
[TOPNAME=${output_top_cell_name}]
xxxxxxxxxx
## merge_three_files.script : merge three files into one using QisMHExtract
## required license: 11003 (QisMLib), 11083 (QisMHExtract)
## required extension: QisMHExtract
script.setif GRID=1e-9 UNITS=1e-6
## open a writer for the merged file
askif key=OUT "msg=Specify the path of the merged file"
cadwriter.open &writer=W grid_m=((GRID)) units_m=((UNITS)) path=((OUT)) format=((FORMAT))
## extract contents of the first file to the writer
askif key=FILE1 "msg=Specify the path of the first file"
lib.load_file &filedb=F input=((FILE1))
hextract.create_extractor &extractor=H $filedb=F
hextract.create_opts &opts=O postname=_1 top=FILE_1
hextractor.extract_to_writer $extractor=H $writer=W $opts=O
hextract.destroy_opts $opts=O
hextract.destroy_extractor $extractor=H
lib.unload_file $filedb=F
## extract contents of the second file to the writer
askif key=FILE2 "msg=Specify the path of the second file"
lib.load_file &filedb=F input=((FILE2))
hextract.create_extractor &extractor=H $filedb=F
hextract.create_opts &opts=O postname=_2 top=FILE_2
hextractor.extract_to_writer $extractor=H $writer=W $opts=O
hextract.destroy_opts $opts=O
hextract.destroy_extractor $extractor=H
lib.unload_file $filedb=F
## extract contents of the third file to the writer
askif key=FILE3 "msg=Specify the path of the third file"
lib.load_file &filedb=F input=((FILE3))
hextract.create_extractor &extractor=H $filedb=F
hextract.create_opts &opts=O postname=_3 top=FILE_3
hextractor.extract_to_writer $extractor=H $writer=W $opts=O
hextract.destroy_opts $opts=O
hextract.destroy_extractor $extractor=H
lib.unload_file $filedb=F
## combine the top cells of each file into a single new cell
cadwriter.begin_cell $writer=W name=MERGE
cadwriter.reference $writer=W name=FILE_1 pos=0,0
cadwriter.reference $writer=W name=FILE_2 pos=0,0
cadwriter.reference $writer=W name=FILE_3 pos=0,0
cadwriter.end_cell $writer=W
## close the merged file
cadwriter.close $writer=W
script.print_vars
xxxxxxxxxx
## execute merge_three_files.script on the command-line
qismscript64.exe
+script:merge_three_files.script
-log:merge_three_files.log
OUT=${output_gds_oas_file_path}
FORMAT=GDS | FORMAT=OAS
FILE1=${first_gds_oas_dbload_file_path}
FILE2=${second_gds_oas_dbload_file_path}
FILE3=${third_gds_oas_dbload_file_path}
xxxxxxxxxx
## gerber_to_gds.script: create a gdsii file from gerber (rs274x)
## requires license: 11003 (QisMLib) 2756 (QisMGerber)
## requires extension: QisMGerber
## ensure required user inputs have been specified
script.required GERBER GDSOUT
## create a database from a gerber (rs274x) file
gerber.load &filedb=F path=((GERBER)) workdir=((WORKDIR)) arcres=((ARCRES)) arcsag=((ARCSAG)) butting=((BUTTING)) thrnum=((THRNUM)) ((DBG)) newunits=((GDSUNITS))
## observe the variables avaiable in the system so far
script.print_vars
## use the QisMFile handle from the database to do something (print a report)
## the QisMFile handle shares the same name as the database ('F')
file.print_report $filedb=F
## create a gdsii file from the database
gerberfile.save_gds $filedb=F path=((GDSOUT))
## destroy the database
gerber.unload $filedb=F
## observe the variables avaiable in the system
script.print_vars
xxxxxxxxxx
## execute gerber_to_gds.script on the command-line
qismscript64.exe
+script:gerber_to_gds.script
-log:gerber_to_gds.log
GERBER=${rs274x_file_path}
GDSOUT=${output_gds_path}
[WORKDIR=${working_dir}]
[GDSUNITS=INCH | GDSUNITS=MIL | GDSUNITS=CM | GDSUNITS=MM | GDSUNITS=UM]
[ARCRES=${arc_resolution}]
[ARCSAG=${chord_error}[,INCH | MIL | CM | MM | UM]]
[BUTTING=${overlap_value}[,INCH | MIL | CM | MM | UM]]
[THRNUM=${n_threads}]
xxxxxxxxxx
## clipx_gerber.script: extract clips (windows) of a gerber database as raster bitmaps
## requires license: 11003 (QisMLib) 2756 (QisMGerber) 4 x 31209 (QisMClipExtract)
## requires extension: QisMClipExtract, QisMGerber
## ensure required user inputs have been specified
script.required GERBER DPI
## create a database from a gerber (rs274x) file
gerber.load &filedb=F path=((GERBER)) workdir=((WORKDIR)) arcres=((ARCRES)) arcsag=((ARCSAG)) butting=((BUTTING)) thrnum=((THRNUM)) ((DBG)) newunits=UM
## record the extents of the home view (in the variable called 'HOME')
file.get_cell_extents $filedb=F &var=HOME
## create a set of randomly selected 16 10000x10000 um windows from the home view
script.new_window_set &set=W rand=clip:((HOME)):10000,10000:16
## generate raster bitmaps for the specified windows using QisMClipExtract
clip.extract_images $filedb=F $windows=W resolution=DPI,((DPI)) thrnum=((THRNUM)) ((INVERT)) ((R2L)) ((B2T)) format=((FORMAT))
## destroy the window set
script.delete_window_set $set=W
## destroy the gerber database
gerber.unload $filedb=F
xxxxxxxxxx
## execute clipx_gerber.script on the command-line
qismscript64.exe
+script:clipx_gerber.script
-log:clipx_gerber.log
GERBER=${rs274x_file_path}
DPI=${dots_per_inch}
FORMAT=TIF
[WORKDIR=${working_dir}]
[ARCRES=${arc_resolution}]
[ARCSAG=${chord_error}[,INCH | MIL | CM | MM | UM]]
[BUTTING=${overlap_value}[,INCH | MIL | CM | MM | UM]]
[THRNUM=${n_threads}]