Horizontal Variation via 3D Polyline
Apply variable deck-edge widths to an AutoBRIDGE Corridor using 3D PolyLines from a linked CAD file as left and right boundary curves — selected by layer name and length.
What is Horizontal Variation (3D Polyline)?
The 3D Polyline method of Horizontal Variation uses CAD polylines from a linked DWG file as the left and right deck edge boundaries. It reads the polylines by their layer name and distinguishes between multiple polylines on the same layer by their measured length. The tool finds where perpendicular rays from each corridor instance intersect those CAD polylines and writes the measured distances into the corridor family's width parameters.
This is the preferred method when project edge geometry already exists in a CAD survey or design file — no Revit Model Line drawing is needed.
CAD Layer Selection
Pick boundary polylines by their DWG layer name — comboBox2/5 list all layers found in the linked CAD file.
Length-Based Identification
When multiple polylines share a layer, distinguish the correct one by selecting its total length from comboBox3/4.
Intersection Point Preview
Computed intersection points are shown as light blue dots (right) and light green dots (left) on the Plan View before RUN.
Full Form Layout
The form is nearly identical to the Model Line version but with one extra row inside the "Model Line Group" GroupBox — adding a second row of combos for polyline length selection. There are 6 stacked zones total.
Select the Corridor Family
Instances Family — comboBox1
Identical to the Model Line method. The full-width dropdown lists every family instance tagged AutoBRIDGE_Type = "AutoBRIDGE_Corridor" in the document, alphabetically. Selecting a corridor triggers comboBox1_SelectedIndexChanged which clears all cached geometry, repopulates comboBox6/7 with family length parameters, and repaints the Plan View.
Select Width Parameters
Width Parameters — comboBox7 (Left) & comboBox6 (Right)
The "Width Parameters" GroupBox contains two side-by-side combos — both populated from the corridor family's Length-type parameters. Selecting either combo immediately repaints the Plan View to reflect the current parameter values as offset stubs.
Select 3D Polyline Source — Layer & Length
This is the key difference from the Model Line method. The "3D Polyline Source" GroupBox has two rows of combos — first pick the CAD layer, then pick the specific polyline by length.
Row 1 — Layer Selection (comboBox5 left, comboBox2 right)
The top row lists all CAD layer names extracted from the linked DWG at form load via CADLayer.GetLayer(). Select the layer containing the left boundary polyline in the green combo, and the layer for the right boundary in the blue combo.
Row 2 — Polyline Length (comboBox4 left, comboBox3 right)
After a layer is selected in Row 1, the corresponding Row 2 combo is populated with the measured lengths of all polylines on that layer. Select the length that matches your target boundary polyline. This is how the tool identifies which polyline to use when multiple share the same layer.
- Selecting the left layer (
comboBox5) triggerscomboBox5_SelectedIndexChanged→ callsPopulateLengthComboBox()→ fillscomboBox4with lengths and clears its selection. - Similarly, selecting right layer (
comboBox2) fillscomboBox3with lengths.
Reading the Plan View
Plan View Canvas — pictureBox1 (with Intersection Dots)
The Plan View works the same as the Model Line version but with an important visual difference: instead of drawing the full boundary curves, it renders the computed intersection points as coloured dots — one dot per corridor instance per side. These dots are cached in cachedIntersectXYZR (right, light blue) and cachedIntersectXYZL (left, light green).
| Element | Colour | Description |
|---|---|---|
| Corridor centreline | Red | Original_X/Y parameters from corridor instances (cached for performance) |
| Right intersections | Light Blue dots | cachedIntersectXYZR — where the right-side perpendicular ray hit the selected CAD polyline |
| Left intersections | Light Green dots | cachedIntersectXYZL — where the left-side perpendicular ray hit the selected CAD polyline |
| Width stubs | Black (3 px) | Lines from each centreline instance to its left/right intersection dot — visually confirms the computed width |
Run — Apply Horizontal Variation
Click RUN — Write Parameters from Cached Intersections
The cyan RUN button (button8) uses the already-computed cachedIntersectXYZR/L points — no re-intersection is performed at run time. For each corridor instance it:
- Retrieves the corresponding cached intersection point for both sides.
- Computes the distance from the corridor point to each intersection point.
- Writes the distance (in project units) to the selected Left and Right width parameters of that corridor instance via the Revit API
Parameter.Set(). - Logs the computed value to the left (green) and right (blue) ListBoxes.
Model Line vs 3D Polyline — Method Comparison
| Feature | Model Line Method | 3D Polyline Method |
|---|---|---|
| Boundary source | Revit Model Lines / Arcs in named Groups | 3D PolyLines in a linked CAD DWG, selected by layer |
| Selection method | One combo per side (Group name) | Two combos per side (Layer name → Polyline length) |
| Plan View display | Full boundary curves drawn (light green / light blue) | Intersection dots only (per corridor instance) |
| Performance | Recomputes at every paint call | Caches intersections; recomputes only on source change |
| Boundary preparation | Draw Model Lines in Revit, group them | Provide a linked DWG with boundary polylines on named layers |
| Corridor combo | comboBox1 (same) | comboBox1 (same) |
| Width parameter combos | comboBox4 (left), comboBox5 (right) | comboBox7 (left), comboBox6 (right) |
| Output | Family parameter write-back on all corridor instances · Values logged in ListBoxes | |
End-to-End Workflow
Link a DWG containing 3D boundary polylines
Ensure each boundary (left edge, right edge) is a 3D PolyLine on a distinctively named layer in the linked file.
Open AutoBRIDGE → Horizontal Variation (3D Polyline)
All AutoBRIDGE corridors and CAD layers are populated automatically at form load.
Select the corridor in comboBox1
Plan View paints the centreline. Width parameter combos populate.
Assign left and right width parameters (comboBox7, comboBox6)
Pick the corridor family length parameters that control the left and right edge distances.
Select left polyline layer and length (comboBox5 → comboBox4)
Pick layer → pick polyline length. Intersection dots appear in light green on Plan View.
Select right polyline layer and length (comboBox2 → comboBox3)
Pick layer → pick polyline length. Intersection dots appear in light blue on Plan View.
Verify Plan View — dots should sit on the intended edges
Black stubs should span from centreline to each dot. Adjust layer/length selection if dots are on the wrong polyline.
Click RUN
Intersection distances are written to corridor instance parameters. Review ListBoxes for per-instance values.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Layer combos empty | No CAD file linked in the project | Use Insert → Link CAD to link the DWG containing boundary polylines |
| Length combo empty after layer selection | No polylines on the selected layer | Confirm polylines exist on that layer in the DWG; re-link if recently edited |
| No intersection dots appear | Perpendicular rays from corridor instances do not hit the selected polyline | Verify the boundary polyline spans the full corridor length; check that the correct layer and length are selected |
| Dots appear on wrong side | Left and Right layer/length selections may be swapped | Swap the layer selections between the left and right combos |
| Some instances show no dot | Boundary polyline has a gap at that chainage | Fill the gap in the DWG, re-link, and re-select the polyline |
| Width parameters empty | No Length-type parameters in the corridor family | Add a Length parameter in the corridor family editor |