Automated Foundation Rebar Drawing Aug 2025

Drawn by Code
Is a picture worth a 1000 words?
If so, does a diagram provide superior documentation?
Let’s make an automated diagram, using Excel, PyXLL, and Python. I built a VBA version of this code about 10 years ago. I converted it to a PyXLL macro in 2018. This week I revisited the code and found it incompatible with my current Microsoft 365 version of Excel. Had to change several aspects of my PyXLL code.

Enough history, now to the present.

PREMISE

I will prepare a diagram showing the plan view of the mat in a spread foundation.

automated drawing

For the layperson:

Rebar is short for reinforcing bar.

In ACI (American Concrete Institute) terminology, “nominal” refers to the standard or intended size of a rebar, often based on its diameter. For example, #8 rebar has a nominal diameter of 8/8 inches, or 1 inch. Rebar sizes are designated by numbers, with each number representing the nominal diameter in eighths of an inch (e.g., #3 rebar is 3/8 inch diameter).

Typically, two grids of rebar are required: a top grid layer and a bottom grid layer. The bottom grid layer is designed for positive moment, the top grid layer is designed for negative moment. In my macro, I illustrate only one of the two grids. A full engineering spreadsheet would, of course, show both grids.

The foundation is specified by length and width. Rebar is specified by nominal size and maximum spacing. In an engineering drawing the number of rebar is also called out, for clarity.

I do not address the design procedure, only the drawing of the finished design.

Below, I offer a static image illustrating a typical rebar layout drawing. Note that this one is entirely sufficient; it is not to scale and that’s okay, even preferable; its is driven by Excel cell values; it was handmade using Excel; and it is easily modified for each new foundation design.

typical rbar layout diagram
This is a typical rebar layout diagram showing the essential elements

VIDEO

Here is a short video illustrating use of the macro.

Note that I simplify and shorten the input dialog, using only two prompts.

The first prompt asks for 3 parameters; the user responds with a space delimited entry of ‘Cover Xdim YDim’. The second prompt asks for 4 parameters; the user responds with a space delimited entry of ‘VBar Xspace HBar YSpace’. Obviously the macro parses the input thereby obtaining the parameter values.

Immediately the diagram is drawn and labeled.

# for example
Cover, Xdim, Ydim = [float(e) for e in rebarparameters.split()]

Leave a Reply

Your email address will not be published. Required fields are marked *