Write a script that draws a grid of posts
Write a short Python script in the Run Script window that draws a grid of square posts at set spacing, then run it and undo it in one step.
TutorialIntermediate10 minMenu: Tools › Plug-ins › Run Script…
A script is the quickest way to draw a repeated pattern, such as the posts of a car park, the columns of a hall or the holes in a panel. This tutorial writes one: twelve solid square posts, four across and three down, 3 m apart. You will see the grid in the drawing and undo it in one step.
The picture at the top is the drawing after the script has run.

What you need
A drawing open in Rodeo. The steps use a new, empty drawing in millimetres. You do not need to know Python beyond what is below. The script imports vs, the module that holds Vectorworks' drawing calls, and calls them as Python functions.
Steps
Choose Tools › Plug-ins › Run Script…. The window opens with a sample script in it.

Click in the script box, press ⌘A to select the sample, and type this in its place:
import vs # a grid of posts: 4 across and 3 down, 3 m apart, each 300 mm square vs.FillPat(1) vs.FillFore(65535, 25000, 0) vs.FillBack(65535, 25000, 0) for i in range(4): for j in range(3): x = i * 3000 y = j * 3000 vs.Rect(x, y, x + 300, y + 300) vs.Message("Drew 12 posts")
Click Run. The grey log under the script says what happened: the script ran, drew twelve posts and made one undo step.

Close the window with × and look at the drawing. Twelve squares, 300 mm across, sit on a grid 3 m apart.
How the script works
vs.FillPat(1)makes the shapes solid.vs.FillForeandvs.FillBackgive the colour as red, green and blue, each from 0 to 65535, and Rodeo uses the nearest colour in the drawing's palette. Here the colour is orange.- The two
forlines repeat the drawing lines for each column (i) and each row (j). Each pass moves the post 3000 mm along, so the spacing is 3 m. vs.Rectdraws a rectangle from one corner to the other, in the drawing's units. The posts are 300 mm, so each runs fromxtox + 300.vs.Messagewrites the line in the log.
Try next
- Change the
4and the3in the tworangelines to draw a bigger or smaller grid, then run again. - Change
3000to the spacing you need, or300to the post size. - Press ⌘Z once after a run. All the posts go at once, because the run is one undo step.
- To keep the script, click Save in the Run Script window. Open… loads it again. To run it with a double-click, put it in a script palette: see Scripts.
Limits
- A solid fill (
FillPat(1)) is drawn in its back colour, in Vectorworks as well as in Rodeo, so the script setsFillBack.FillForecolours a solid fill only withFillPat(2), Solid Foreground. - Rodeo has more than 1,100 of Vectorworks' 3,250 calls. A call it lacks says so by name in the log.