Vertical Opening on Corridor or Slab
Cut a void vertically through any AutoBRIDGE corridor or slab family by drawing the opening shape as model lines — grouped in Revit — and letting AutoBRIDGE loft them into a void form inside the family in one click.
Why Use Vertical Opening?
When a corridor or slab family needs a penetration — a drainage channel, a cable tray opening, a utility duct — you need a void that passes through the family vertically. The Vertical Opening tool (VerticalOpening.cs) does this in a single click: draw the opening plan shape as model lines in Revit, group them, select the group in this form, and AutoBRIDGE lofts that shape into a void inside the family document and reloads it into your project.
Corridor Mode
Works on any AutoBRIDGE corridor family with AutoBRIDGE_Type = AutoBRIDGE_Corridor.
Slab Mode
Switches to families tagged AutoBRIDGE_Type = AutoBRIDGE_Slab. Space parameters are disabled in this mode.
Any Shape
Draw rectangles, circles, arcs, or splines — the group can contain any mix of curve types.
Live Plan Preview
The canvas shows the corridor centreline, left/right extents, and the opening shape overlaid in green — confirming position before you run.
One-Click Void
AutoBRIDGE opens the family, lofts the void at Z = ±500 mm, and reloads it into the project automatically.
Form Layout — Six Zones
| # | Zone | Purpose |
|---|---|---|
| 1 | Instances Family (Row 0, 74 px) | comboBox1 — corridor or slab family name. radioButton1 Corridor · radioButton2 Slab toggle. |
| 2 | Left & Right Space Params (Row 1, 74 px) | comboBox2 Left Space · comboBox4 Right Space — optional length parameters from the selected family. Only active in Corridor mode. |
| 3 | Model Line Group (Row 2, 74 px) | comboBox3 — lists all Revit Groups in the project. Select the group containing the opening model lines. |
| 4 | Plan View Canvas (Row 3, 75 %) | GDI+ plan preview — centreline in red, left/right extents in black, opening shape in light green with transparent fill. North indicator top-left. |
| 5 | Log List (Row 4, 25 %) | listBox2 — real-time progress log; reports each step from curve extraction to family reload. |
| 6 | Run Bar (Row 5, 62 px) | button8 "RUN" — cyan, right-docked. Executes void creation and family reload. |
Select the Target Family
The first group box — Instances Family — is where you choose whether you're operating on a Corridor or a Slab, and which specific family to modify.
Choose Mode: Corridor or Slab
The two radio buttons on the right of the family group box switch the tool between Corridor (default, checked) and Slab mode. Switching mode immediately repopulates comboBox1 by filtering all adaptive family instances in the project by their AutoBRIDGE_Type parameter value.
Select the Corridor or Slab Family
comboBox1 is populated by scanning all family instances in the active document for ones with an AutoBRIDGE_Type parameter set to "AutoBRIDGE_Corridor" or "AutoBRIDGE_Slab" depending on the selected mode. Family names are collected into a unique set and sorted alphabetically.
Once a family is selected, PopulateParameterComboBoxes() opens the family document via doc.EditFamily() and reads all Length-type parameters to fill the Left and Right Space dropdowns.
Left & Right Space Parameters (Optional)
The second group box — Left and Right Space Parameters (Optional) — lets you map the corridor's width parameters to the plan view so you can visually confirm that your opening model lines fall within the corridor deck extent.
Select Left and Right Space Parameters
After selecting a family in Phase 1, comboBox2 (Left Space Parameter) and comboBox4 (Right Space Parameter) are populated with all Length-type instance parameters found in the family document. Select the parameters that represent the half-widths of the deck from the centreline.
In the plan view canvas, the tool draws a line from each corridor instance's centreline position in the direction of the cross-section vector for the selected length value. This shows the deck edge on each side, allowing you to visually verify the opening fits within the deck width.
Define the Opening with a Model Line Group
The Model Line Group dropdown lists every Revit Group in the active document. The selected group must contain the model lines that define the plan-view footprint of the void opening.
comboBox3.
Draw the Opening Shape as Model Lines
Draw the plan shape of the void in the correct position relative to the corridor centreline. The shape can be made of any combination of:
- Lines — straight edges (projected as-is)
- Arcs — projected by interpolating along the arc and re-creating it
- Circles — full circular openings (unbound Arc in Revit terms)
- Splines / NurbSplines — tessellated into 1-metre line segments automatically
Select the Group in the Dropdown
comboBox3 lists all Group objects in the active Revit document. Select the group you created. The plan view canvas immediately refreshes to show the group's curves overlaid in light green with a semi-transparent fill.
Reading the Plan View Canvas
The large [PLAN] canvas is a GDI+ drawing that projects all corridor/slab geometry and the opening group into a 2D plan view. Use it to visually verify the opening position before running.
What the Canvas Shows
The canvas draws four elements in plan:
- Red lines — the corridor centreline, drawn by connecting the
Original_XandOriginal_Yparameter values of each family instance, translated to project coordinates - Black lines — the Left and Right Space parameter extents, drawn as vectors from each centreline point in the cross-section offset direction
- Light green lines + fill — every curve extracted from the selected Model Line Group, overlaid at their actual project coordinates
- North indicator — a compass image pinned top-left of the canvas
Navigate the Canvas
The plan canvas supports three interactions to help you inspect the opening position at any scale:
| Action | Input | Effect |
|---|---|---|
| Zoom | Scroll wheel | Scales the view by ±10% per step (min 0.1×, max 20×) |
| Pan | Left-drag | Shifts the viewport by the drag delta in screen pixels |
| Reset view | Double-click | Resets zoom to 1.0× and pan to zero |
Every parameter change, radio button toggle, and dropdown selection automatically calls pictureBox1.Invalidate() to refresh the canvas — no manual refresh needed.
Run — Create the Void
The RUN button triggers a seven-step pipeline: it extracts the model line curves, adjusts them to the family's coordinate system, lofts them into a void form inside the family document, and reloads the modified family into the project.
Pre-flight Validation
Before any geometry is created, RUN checks:
- A family is selected in
comboBox1 - A group is selected in
comboBox3 - The selected group name is unique in the project (no duplicates)
- The group contains at least one valid curve
- The family document can be opened via
doc.EditFamily()
Failures at any step show a TaskDialog error and abort — no changes are made to the model.
Curves Extracted and Adjusted
AutoBRIDGE retrieves all model lines from the group using GetCurvesFromModelLines(), then finds the family instance's insertion point via GetFamilyInstanceLocation(). Each curve is translated by (-insertionPoint.X, -insertionPoint.Y, -insertionPoint.Z) to convert from project coordinates to the family's local coordinate system.
Void Loft Created Inside the Family
Inside a single Revit transaction on the family document, CreateLoftFromModelLineCurves():
- Creates a sketch plane at Z = −500 mm and projects all adjusted curves onto it → creates model curves → builds
ReferenceArray 1 - Creates a sketch plane at Z = +500 mm and places the same curves (translated by 100 mm Z, then projected) → builds
ReferenceArray 2 - Calls
familyDoc.FamilyCreate.NewLoftForm(false, refArrArr)to create the void loft form passing through the full family height
Family Reloaded into the Project
After the transaction commits, familyDoc.LoadFamily(doc, new FamilyLoadOptions()) reloads the modified family back into the Revit project with overwriteParameterValues = true. All existing corridor instances immediately show the new void cut. A success TaskDialog confirms completion.
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
| comboBox1 is empty | No family instances with AutoBRIDGE_Type parameter in the project | Ensure corridor or slab instances were created by AutoBRIDGE — manually placed families won't have this parameter |
| comboBox3 is empty | No Groups exist in the project | Draw model lines and group them: Select → Modify → Create Group |
| Duplicate group name error | Two or more groups share the same name | Rename one group (right-click the group in the Project Browser → Rename) or purge unused groups |
| "No valid curves found" | The selected group contains only detail lines or annotation, not model lines | Re-draw using Architecture → Model Line, not Annotate → Detail Line |
| Void in wrong position | Model lines were drawn at a different elevation than the corridor insertion point | Draw model lines in a plan view at the correct level; confirm insertion point Z in Properties |
| Canvas shows no green lines | Group selected but its curves are far from the corridor in plan | Zoom out in the canvas (scroll down) to locate the green lines; pan to bring them into view |
| Loft form creation fails | Open curves (not closed loops) passed to the loft | Ensure the model lines form a closed loop — the loft requires a closed profile |