In this Topic Hide
The SIMetrix script language provides a number of functions and commands that allow non-interactive printing. That is printing without user intervention. This is useful for - say - running multiple simulations in the background and automatically printing the results when the simulation is complete. The same printing facilities may also be used to customise the layout of printed schematics and graphs. The user interface provides a method of printing a single graph and schematic on the same sheet, but other arrangements are possible using the underlying printing commands.
The available printing commands are:
The functions are:The sequence for a print job is:
Suppose we wish to create a PDF file using 'Acrobat Distiller' for the current graph. Of course you can readily do this by selecting File|Print... and making the appropriate selections using the dialog box. This is no good, however, if you want to create a PDF file for a graph created using an automated simulation, perhaps run overnight. The following script will do this without user intervention.
** Get info on system printers |
Let printInfo = GetPrinterInfo() |
** Search for acrobat distiller. The printer list from GetPrinterInfo |
** starts at index 2 so we subtract 2 to get the index |
** needed by OpenPrinter |
Let distillerIndex = Search(printInfo, 'Acrobat Distiller')-2 |
** If Acrobat distiller is not on the system |
** Search will return -1 |
if distillerIndex<0 then |
Echo "Acrobat Distiller is not installed" |
exit script |
endif |
** Open Printer using distiller. |
** Orientation will be landscape which is the default |
** Number of copies = 1. |
** The title will be used by distiller to compose the file name |
** for the PDF file i.e. Graph1.PDF |
OpenPrinter /title Graph1 /index {distillerIndex} |
** Now print the graph |
** Major axis on minor axis off. All margins 20mm. |
PrintGraph /major on /minor off /margin 20 20 20 20 /caption |
"Test Print" |
** Close Printer. This will actually start the print |
ClosePrinter |
Show GetPrinterInfo() |
If you omit /index switch for the OpenPrinter command, the application default printer (not the system default printer) will be used. The application default printer is the same as the system default printer when SIMetrix starts but will change whenever the user selects a different printer using the SIMetrix File|Print... dialog box.
|