Skip to the page
Tutorial areas

Python or Vectorscript: which to write

Python and Vectorscript both run in the Run Script window and make the same Vectorworks calls, so choose by the script you have and the language you know.

ConceptIntermediate4 minMenu: Tools › Plug-ins › Run Script…

Rodeo runs two kinds of script for Vectorworks in the same window: Python, which imports the vs module, and Vectorscript, the older language with PROCEDURE, BEGIN and END. Both call the same drawing functions, so the choice is about the language you know and the script you already have, not about what the script can draw.

How Rodeo tells them apart

A file ending in .vs or .px is Vectorscript. So is any script that starts with PROCEDURE or FUNCTION. Anything else runs as Python. The log says which one ran, as in this Vectorscript that draws four posts:

The Run Script window with a Vectorscript that draws four posts, and the log saying Running script.py (Vectorscript)

Write Python when

  • You know Python, or you want its lists, strings and loops in the script.
  • You are writing something new and want to test pieces by printing them with print.

Start with import vs, then call the functions as vs.Rect(...).

Write Vectorscript when

  • You already have a Vectorscript from Vectorworks, or from File › Export › Export Script, which writes the drawing in this language. See Export a drawing as a script.
  • Your team reads Vectorscript and Python is not needed.

Vectorscript has VAR declarations, FOR ... TO ... DO loops, and procedures and functions nested inside each other.

Limits that differ

  • Vectorscript refuses GOTO.
  • {$INCLUDE} finds only files installed with a plug-in, so a script run from the Run Script window cannot include another file.
  • A CHAR is read as a string.
  • A Python script has no network, and neither kind of script can fetch anything from the internet. Both kinds lack the same Vectorworks calls, which What scripts can and cannot do yet lists.