In this topic:
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.
** 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 ClosePrinterYou can of course replace 'Acrobat Distiller' with any printer that is on your system. You must use the printer's name as listed in the Printers section of the system control panel. You can also find a list of system printers from within SIMetrix by typing at the command line:
Show GetPrinterInfo()The first two values are numbers but the remaining are the currently installed printers on your system.
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.
◄ User Defined Binary Functions | Schematic Template Scripts ▶ |