Skip to the page
Tutorial areas

Export a drawing as a script

Export a drawing's 2D objects as a Vectorscript file, then run that file in the Run Script window to draw them again.

How-toIntermediate5 minMenu: File › Export › Export Script

Export Script writes a drawing as a Vectorscript file. Running that file draws the same 2D objects again, on design layers of the same names, with their classes, stacking order and attributes. Use it to keep a copy of a plan as a script, or to pass a drawing to someone who runs Vectorworks scripts.

Steps

  1. Draw the plan. This one is a room outline and a filled square inside it.

    The canvas with a teal room outline and an orange square inside it
  2. Choose File › Export › Export Script. The export starts at once, with no window to fill in.

    The Export submenu with Export Script picked out
  3. The browser saves the file as a download with a .vs name. It is plain text, and its first lines say which drawing it came from and what it draws.

  4. To check the file, select everything with ⌘A and choose Edit › Delete. The drawing is now empty.

  5. To draw the plan again, choose Tools › Plug-ins › Run Script…, click Open… and choose the file. The window shows the script, and the log says Opened with the file's name.

    The Run Script window with the exported script open
  6. Click Run. The objects are drawn again on their layer, and the run is one undo step.

    The drawing with the room outline and the square drawn again

What is in the file

The script draws the drawing's 2D objects from its design layers. The header counts what it leaves out, and what it writes more plainly. It writes a hatch or a dashed line as solid, and it leaves out symbols, plug-in objects, 3D objects, pictures and sheet layers.

The script checks the drawing's units when it runs. It draws in millimetres, so a drawing in other units stops with a message that tells you to set the units in File › Document Settings › Units first.

Tips

  • Export the drawing before you change it, so the script keeps the version you want.
  • A .vs file is a Vectorscript. To write a script by hand in Python instead, see Run a Python script on the drawing.

Limits

  • Symbols, plug-in objects, 3D objects, pictures and sheet layers are not written.
  • Hatches and dashed lines come back as solid lines.