Premise
Structural BIM practice generates large volumes of repetitive technical work: drawing reinforcement ribbons to NTC2018 standard, building quantity schedules from scratch, computing net formwork areas accounting for element contact zones, annotating dimension chains across hundreds of detail sheets. At GPA Ingegneria Srl, a Naples-based structural engineering consultancy, this work was being performed manually — consuming hours that could otherwise go to engineering judgement.
The pyGPA extension is a suite of Python tools built inside the pyRevit framework to automate this production layer. Each tool targets one specific recurring task, replaces a manual sequence with a single button click, and writes its output directly into the Revit model — as new model elements, shared parameters, or schedule entries — so results remain synchronized with every geometry change.
Development made systematic use of AI-assisted code generation, working with Claude and ChatGPT to prototype, debug, and extend tools that require deep Revit API knowledge alongside domain-specific engineering criteria — Italian structural codes, QS conventions, BIM data protocols. The result is a production library of seven tools distributed across five specialized panels in the pyRevit ribbon.
Case Study 01 — Reinforcement Detailing at Code
Tool: AutoRebar | Panel: PyGPA | ~640 lines
In structural detail drawings, reinforcing bars must be represented as solid cross-section ribbons — not single lines. The ribbon width reflects the bar diameter; bend radii at corners must comply with NTC2018 Article 11.3: a minimum mandrel radius of 2.5Ø for bars of 16mm or less, and 4.0Ø for bars exceeding 16mm. Drawing these ribbons manually — accounting for mitre geometry at every corner junction, offsetting curves correctly inward and outward, verifying that the resulting radius satisfies the code requirement for the given diameter — is one of the most time-consuming operations in structural documentation.
AutoRebar automates the process entirely. The engineer draws the bar’s centreline as connected detail lines and arcs in any Revit detail view — a free-form sketch that captures the bar’s path through the cross-section. AutoRebar reads this centreline geometry, prompts for bar diameter and labelling prefix, and constructs the physical ribbon automatically:
- Straight segments are offset symmetrically by ±Ø/2 to define the ribbon width
- Curved segments are replaced by inward and outward tangent arc pairs, with radii recalculated to maintain NTC2018 mandrel compliance regardless of the original sketch arc
- All segments are chained, sealed into a closed CurveLoop, and deposited as a grey FilledRegion in a single Revit transaction
- Text annotations mark each segment’s length in centimetres, the total bar length (Ltot) appears at a user-specified position, and bend angles are noted at every junction
A detail that previously required ten to fifteen minutes of manual offsetting and annotation is produced in seconds from a free-form centreline sketch.
Case Study 02 — Automatic Quantity Schedules
Tool: AutoAbacus | Panel: CME (Computo Metrico Estimativo) | ~180 lines
The Italian CME — Computo Metrico Estimativo, the Bill of Quantities — requires a structured summary of all structural elements organized by family type, with accumulated lengths, areas, volumes, structural material designations, and WBS cost-breakdown codes. In Revit, assembling this schedule set from nothing — creating a view for each structural category, adding the correct fields, enabling quantity totals, setting metric units, applying grouping headers — is a half-hour operation, repeated fresh at the start of every project.
AutoAbacus generates the complete set of five structural schedules in one click:
- Walls — Family & Type, Type Mark, Area (m²), Volume (m³), Structural Material, all WBS parameters found in the project
- Structural Framing — same fields, plus Length (m) and Cut Length (m) for beam and brace quantification
- Structural Columns — same as Walls
- Foundations — same as Walls
- Floors/Slabs — same as Walls
For every schedule the tool enables Grand Total rows, applies metric display units, and groups elements by Family and Type. Shared WBS parameters are detected automatically from the project’s parameter file and added to all schedules. The operation is idempotent: existing schedules are left unchanged, so the tool is safe to re-run after model updates. A setup task that previously consumed thirty minutes is complete in under ten seconds.
Case Study 03 — Net Formwork Area Calculation
Tools: Setup Parameters + Calculate Areas | Panel: Formwork | ~830 lines combined
Formwork quantification for reinforced concrete structures requires calculating the net surface area that requires shuttering — each element’s total surface area minus the areas in contact with adjacent structural elements. A wall face that abuts a column, a slab soffit that lands on a beam flange — these contact zones need no formwork. The deduction is geometrically straightforward in principle, but practically complex in Revit: the software’s automatic join operations merge element solids at junctions, removing or distorting the original contact faces so that they can no longer be measured directly.
The Formwork suite addresses this in two scripts.
Setup Parameters registers nine shared parameters across all five structural categories — written to the Analysis Results parameter group with deterministic GUIDs for cross-project stability:
Formwork_Area_Total— raw surface area before deductionFormwork_Area_Net— net formwork area after contact deductionFormwork_Area_Net_Vertical/Formwork_Area_Net_Horizontal— net area by orientationFormwork_Area_Contact— total detected contact zone areaFormwork_Contact_Count— number of adjacent elements identifiedFormwork_Efficiency_Percent— ratio of net to total, for quality review
Calculate Areas runs the geometric computation. For each element, total surface area is computed by iterating across solid faces from the Revit geometry engine. Contact detection runs in two passes. First, a face-to-face adjacency check tests whether faces from neighbouring elements share coincident normal vectors and overlapping projection domains — this catches directly joined faces that Revit preserves. Second, a bounding-box intersection fallback recovers T-junctions where Revit’s join operation has already removed one of the two contact faces from the model geometry. Walls receive special treatment: their bounding boxes are reconstructed from LocationCurve endpoints and wall height and thickness parameters rather than from solid geometry — making them immune to the join artefacts that distort wall solids at intersections with beams and columns. Computed net areas are classified as vertical (wall-to-wall) or horizontal (slab-to-beam, column-to-slab) and written to the element parameters created by Setup Parameters. A typical structural model of 300–800 elements processes in under a minute.
Case Study 04 — Detail Line Annotation
Tools: Quote + Addlen | Panel: Annotazione / PyGPA | ~200 lines combined
Two lightweight utilities address the most common repetitive operation in structural detail views: measuring and labelling connected line chains.
Quote operates on selected detail lines. It builds a graph from all segment endpoints, identifies connected chains by breadth-first traversal, and places a rotated text note at the midpoint of every segment — labelled with that segment’s length and aligned to the segment direction. A Ltot annotation is placed at the chain centroid. Units (mm, cm, or m) and text style are set once in the prompt; all labels are placed in a single transaction. Annotating a forty-five detail sheet that previously took fifteen minutes is done in under thirty seconds.
Addlen is a quick-sum utility: select any set of detail lines and receive an immediate total length readout in centimetres. Used during drafting to verify that a manually drawn chain matches the intended total dimension, or to quickly build bar cut lists from existing detail geometry before running the full Quote annotation.
Case Study 05 — Model Hygiene
Tools: Disgiungere + Rinomina materiali + AutoFilletRegion | Panel: Geometria / Parametro / PyGPA | ~200 lines combined
Three utilities address recurring model management operations that are individually simple but high-volume.
Disgiungere (Disallow Joins) removes Revit’s automatic join behaviour from selected walls and structural framing in bulk. Automatic joins between walls and beams frequently generate geometry artefacts — ghost faces, inverted normals, incorrect section cuts — that interfere with formwork calculation, clash detection, and detail view generation. Removing joins is normally a one-element-one-end operation through Revit’s contextual menu; Disgiungere processes any multi-element selection in a single transaction across both ends of every element simultaneously.
Rinomina materiali (Rename Materials) provides batch material renaming through a WPF dialog. Structural models received from external consultants often carry material names that follow the consultant’s internal convention rather than GPA’s project template naming scheme. The tool presents a filter interface — match by exact string, contains, starts-with, or ends-with, with optional case insensitivity — and applies find-and-replace, prefix, and suffix operations to all matching materials at once. Name conflicts are resolved automatically with sequential suffixes; a full rename log is written to the pyRevit output panel for review.
AutoFilletRegion projects 3D building elements into the current view as flat 2D filled regions. For each selected element the tool attempts to extract the most view-normal face from solid geometry and project it into view coordinates; if no face is recoverable, it falls back to the element’s projected bounding box. This is used to generate rapid hatch coverage over structural assemblies in detail section views — placing a closed filled region over a beam or column cross-section without requiring the engineer to redraw its boundary manually.