Loading and running pre-programmed scripts

If you have a pre-programmed script that you want to run, follow the procedure on this page. The procedure is in two parts: (1) loading the script and (2) running it.

To load a script

 

IMPORTANT: You receive the script files in an archive. You begin by extracting the files into your installation's JScript folder.

  1. Ensure that Package & Display Designer is closed.
  2. In the JScript folder of your installation, extract the archive file in your installation's script folder. Normally, this folder is: C:\Program Files\EngView Systems\Package & Display Designer Suite\Package Designer\Scripts\JScript.

NOTE: If your Version 7 installation is an upgrade from Version 6 or an earlier version, the folder's location will be: C:\Program Files (x86)\EngView Systems\Package & Display Designer Suite\Package Designer\Scripts\JScript.

  1. In the script folder, use a code editor to open the script file (it's a JS file).
  2. In the script file, the section above the line

function Init()

contains all user-editable parameters. Here you will set the folders in which you want the script to execute.

  1. Edit the following destinations (shown in red) by typing — between the quotation marks (!) — the folder names where you want the script to execute. Use the comments (in green) as guides:

// path where the NCfile will be saved (for GenerateNC)

var NCfileDestinationPath = "D:/Temp/";

//path where the text file will be saved (for scr9662, part of GenerateNC)

var labelFileExportPath = "D:/Temp/";

var dframeName = "57745_PrinzhornScript.evf";

//path where the pdf file will be saved (for scr9664, part of GenerateNC)

var pdfFileExportPath = "D:/Temp/";

//path where the csv file will be saved (for DesignFrameStatisticsOutput)

var statisticsFileExportPath = "D:/Temp/";

  1. (Optional) If for some reason you change the name of the script folder, for the script's buttons you must then rename the references to the script folder. The references must be identical with the folder name:

var button0 = newTab.AddMacrosButton("JScript", "Type the script's new folder name here", "GenerateNC", imgFolder + "GenerateNC.png", "Generate NC file", "Generate NC file.");

  1. (Optional) Repeat Step 6 for each script button in the script.
  2. Save the file and close it.

To run the script

  1. Start Package & Display Designer.
  1. On the Help menu, click Register.

The Register dialog box appears.

  1. Select the API module (pictured).

IMPORTANT: If the license you work with — network or local protection — does not feature these modules, write to support@engview.com to request them.

  1. Click OK.

A message appears prompting you to restart the program before the scripts can be used.

  1. Click OK to close the message, and then restart the program.

After the program has restarted, the script files are loaded. The script's icons appear on a separate Scripts toolbar.