Skip to content

Code samples

Learn the API with a short walkthrough, then explore larger projects that create intersections, connect Sites into a Network, work with volume scenarios and read results.

Start with a short walkthrough

Open an existing project, analyse each Site and print two results. The same task is explained step by step in C#, C++ and Python.

Choose a language

Understand the sample projects

Download the larger examples and follow the guide to understand what each one does, which source files to open and how to run it.

Read the sample project guide

Short walkthroughs

Each walkthrough follows the same sequence:

  1. Connect to the installed SIDRA API and open your .sipx project.
  2. Go through every Site folder and analyse each Site (intersection).
  3. Print the Site name, level of service and degree of saturation.
  4. Close the API.

You supply an existing project. These walkthroughs analyse individual Sites; they do not create geometry or run a Network analysis. Complete the Getting started prerequisites first.

Language Binding Walkthrough
C# Late-binding wrapper, .NET 8, x64 Build a console application
C++ COM type library, Visual C++ with ATL, x64 Build a COM client
Python Python.NET with .NET 8 and 64-bit Python Run a Python script

VB.NET applications can use the same late-binding wrapper as C#. See C# / VB.NET setup for the reference and target requirements.

Find a project example by task

The larger examples create Sites and Networks, read input settings, work with volume scenarios and read results. They need no project of your own: each one creates the files it uses.

Every example below is available in C#, C++ and Python, with the same name and the same behaviour in each. Choose a task to read its explanation in the Sample project guide, which also has the download button for the ZIP containing all of them.

I want to... Example
Connect two intersections and analyse a Network Freeway diamond interchange
Read permitted lane disciplines and opposing movements Lane disciplines and priorities
Create a signalised intersection Signalised Site
Create a roundabout and set its lane disciplines Roundabouts
Create other Site types, including a turbo roundabout Additional Site types
Reuse volumes across Sites and Network Scenarios Volume Bins and Scenarios
Read Site, movement and lane results Reading results

For the wrapper files and offline Help, see Downloads. For samples matching an older installation, see Previous versions. If a sample fails to load the API or open your project, see Troubleshooting.