Adding railway sleepers in Civil 3D

Corridors can be used in Civil 3D to design linear elements like roads, railway lines or retaining walls.



The assembly will be extruded along the baseline of the corridor to generate the object, which is what is required in most situations. However, sometimes we can have discrete elements in the assembly that need to be inserted at a certain interval along the baseline, rather than added as a constant extrusion. This is what happens with railway sleepers, also known as railroad ties or crossties.

A possible approach can be to use a conditional subassembly and apply a different assembly to the corridor based on the presence or absence of a polyline along the baseline of the corridor. In this example, we will be using Dynamo to automate the creation of those polylines, that will then be applied to the corridor as a target of the conditional subassembly.

To create the assembly, we start by inserting the ‘ConditionalHorizontalTarget’ subassembly directly in the baseline of the assembly. It needs to be inserted twice, once with the ‘Type’ parameter set to ‘Target Not Found’ and again with ‘Target Found’.
 
To illustrate this workflow, we will use the ‘Internal_Multi_Track’ subassembly. Omit the tie when the target is not found and include it when it is found.
 
The resulting assembly is shown below. Note how the railroad tie only displays when the target is found.

Our next task is to draw some polylines along the baseline of the corridor where the sleepers should go. The following steps will guide you through the creation of a Dynamo script to achieve this goal.

Select the corresponding baseline from the corridor.

Using this baseline, the following group will generate a list with the start and end chainages for all the polylines. The width and spacing of the tie are provided as an input and the resulting chainages will be centred around the baseline ensuring that no ties go beyond the start or the end chainages of the baseline.


Extract the start and end points of the polylines from the baseline using the list of chainages that we calculated previously. Those points will then be used to insert the polylines in the drawing in a layer of our choosing.

To finish the script, we check the ‘Is Input’ property for all the input nodes to enable the script to be executed from Dynamo Player.

Execute the Dynamo script adjusting the inputs accordingly.
 
After executing the script, you will see some polylines along the specified baseline with a length equal to the ‘Tie Width’ and a distance between them based on the ‘Tie Spacing’ provided. These polylines indicate where the sleepers should be placed.

There just remains to apply those polylines as targets of the conditional subassemblies in the corridor. Since all of those polylines have been created in the same layer, all of them can be easily selected at once.

The resulting corridor can be seen below, with the sleepers shown in red. The ballast reaches the top level of the sleeper in the gaps between them.

If you would like to improve your Civil 3D and Dynamo skills, you can have a look at our courses here.

Alternatively, our Civil Engineering consultancy services can be found here.


Sovelia Vault: The Smarter Way to Manage Design Data

04 November 2025

If you are an Autodesk Vault user in the mechanical engineering and manufacturing industry, you are likely familiar with the challenges of managing design data. While Vault provides a solid foundation for storing and organising design data, it falls short in some critical areas. You might have noticed this if you ever wanted to automate workflows or configure company-specific rules and processes in Vault. Let’s dive into these challenges and possible solutions. 

5 Tips to Work Smarter in Autodesk Vault

03 November 2025

Sovelia Vault is an automation platform for Autodesk Vault, providing enhanced flexibility, control, and customisation. Discover 5 tips to work smarter and streamline your Autodesk Vault workflows with Sovelia Vault.

Cybersecurity Starts with Awareness

27 October 2025

Discover the hidden cybersecurity risks many businesses overlook—from improper data disposal and insecure API integrations to forgotten digital footprints left by former employees. Learn practical steps to reduce your exposure and protect sensitive data. Plus, get expert insights and register for our upcoming webinar on data security and compliance in Autodesk’s new regional hubs.