Creating and Editing Script Palettes and Scripts

Document scripts can be created, saved, and executed within a Vectorworks file. Scripts must be nested in script palette folders. Use the Resource Manager to manage script palettes folders as well as individual document scripts.

Creating Scripts

To create a script:

  1. From the Resource Manager, click New Resource, select Script, and then click Create. Alternatively, from the Resource Manager, select Scripts from the list of resource types on the tool bar, and click New Script.

  2. Scripts must be placed in a script palette folder. Do one of the following:

  3.     If script palettes exist in the file, the Select Script Palette dialog box opens; select the palette to add the script to and click Select, or click New Palette to create a palette.

        If no script palette exists, a new palette is created automatically; enter a name for a new palette.

  4. The Assign Name dialog box opens. Enter the name of the script and click OK.

  5. The Script Editor opens to begin a script editing session. The editor provides a basic authoring environment for script development and maintenance. Its features allow you to create, edit, and compile scripts, browse available functions, view errors, and perform other tasks associated with creating scripts. Select the script language for the script: Python Script or VectorScript. Scripts are limited to 32,001 characters. For detailed developer-oriented documentation related to Python and VectorScript, please navigate to developer.vectorworks.net.

  6. Scripts00005.png 

  7. When the script is complete, click OK to save it.

Scripts can be edited, renamed, deleted, exported, imported, moved, and executed from the Resource Manager.

Editing Scripts

To edit an existing script:

  1. From the Resource Manager, right-click (Windows) or Ctrl-click (Mac) on the resource, and select Edit from the context menu. Scripts are nested in script palette folders.

  2. The Script Editor opens, displaying the script source code. See Creating and Editing Script Palettes and Scripts for a description of the Script Editor.

Encrypting Scripts

Encrypt a script to prevent editing.

To encrypt a script file:

  1. Select Tools > Plug-ins > Encrypt Script.

  2. The Choose Script File dialog box opens.

  3. Locate and select the script file to encrypt.

  4. Click Open.

  5. The Save Encrypted VectorScript Code Document dialog box opens.

  6. Enter a new name for the script, and then select the location for saving the file.

  7. Click Save.

The script is saved in an encrypted format.

~~~~~~~~~~~~~~~~~~~~~~~~~

Running Scripts

Resource Manager

Using Scripts

Was this page helpful?

vectorworks.net