Vertical Variation Civil 3D Profile
Drive a corridor height parameter at every station directly from a Civil 3D alignment profile — the most precise method, fully tied to the design road geometry including vertical curves and variable grades.
Civil 3D Profile Method
This method queries a Civil 3D profile for the target elevation at every corridor station. For each nested adaptive instance, AutoBRIDGE computes the absolute difference between the instance's current world Z and the profile elevation at its station, then writes that delta to the selected length parameter.
The result is a corridor whose cross-section parameter — slab depth, haunch height, or any length dimension — smoothly follows the vertical road geometry defined in Civil 3D, including vertical curves, sag and crest transitions, and variable grades.
Full Form Layout
The Civil 3D form has five zones. Row A is unique to this method — the Instances Family groupBox (65%) and Parameter Direction groupBox (35%) share the first row. The full-width Civil 3D alignment row sits below it.
Select the Corridor Family & Parameter
Instances Family — comboBox5
Lists all families in the Revit document with AutoBRIDGE_Type = "AutoBRIDGE_Corridor". Select the corridor to vary. Selecting auto-populates comboBox4 with all length instance parameters found in the family.
comboBox5 and comboBox4 are disabled until all three Civil 3D combos (Document, Alignment, Profile) have a selection. Set those in Row B first.
Parameter Name — comboBox4
Pick the length parameter to write to. Must be an Instance parameter with no formula. Common examples: Top_variable, Haunch_Depth, Slab_Thickness.
Parameter Direction — Up / Down
Choose Up if the parameter grows upward from the instance base Z (e.g. top-of-slab thickness). Choose Down if it grows downward (e.g. haunch depth). Toggling immediately refreshes the elevation preview.
Select the Civil 3D Source
Document → Alignment → Profile (cascading)
Fill all three combos in the Civil 3D Alignment groupBox:
comboBox1 — Documents: all.dwgfiles open in Civil 3D. Select the source file.comboBox2 — Alignments: populates after document. Pick the bridge centreline alignment.comboBox3 — Profiles: populates after alignment. Pick the design profile.
The ± field adds a uniform elevation offset in metres to every profile elevation before the delta is computed — useful for datum corrections or design clearance adjustments.
Verify the Preview & Run
Reading the Elevation Preview Canvas
Before clicking RUN, confirm the preview shows the correct relationships:
- Blue curve — Civil 3D profile (target elevation to reach)
- Red dashed curve — corridor base Z at each station (current instance positions)
- Black curve — current parameter top (base Z + existing parameter value)
- Green band — the current parameter height occupying the gap between red and black
After a successful RUN, the black curve should coincide with the blue profile — meaning the parameter now bridges the exact gap between corridor base and the target elevation.
RUN Pipeline
Read nested instances from corridor family
Opens the selected family for editing and retrieves all nested adaptive instances from the family document.
Read current base Z of each instance
Gets world Z of each instance LocationPoint, adjusted by the main family's global position.
Query Civil 3D profile at each station
Reads the Station parameter from every instance, calls GetProfileElevationByStation on the Civil 3D profile, applies the ± offset.
Compute |profile elevation − base Z|
Absolute difference always positive. Up/Down convention handled by the family geometry.
Write delta to the selected parameter
Single Revit transaction: sets the parameter on every nested instance. Values logged to listBox1.
Delete old forms and rebuild solid/void geometry
All Form elements deleted. CreateLoftForm called for each solid then void subcategory.
Reload family into the Revit project
Updated geometry immediately visible. Elevation preview redraws showing the new state.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| comboBox5 / comboBox4 are greyed out | Civil 3D combos not all selected | Fill Document → Alignment → Profile in Row B first — they unlock the family controls. |
| Civil 3D comboBox1 is empty | Civil 3D not running or no DWG open | Open AutoCAD Civil 3D with the correct DWG file before opening this form. |
| Geometry inverted after RUN | Wrong Up/Down direction | Toggle direction and re-run. Check green band is on the correct side of the red base line. |
| Parameter values near-zero on all instances | Profile elevation ≤ base Z | Check the profile is above corridor base Z. Use ± offset if a datum correction is needed. |
| COM error after retrying 5 times | Unstable Civil 3D connection | Restart Civil 3D and reopen the form. |