Skip to content

Sample project guide

Learn what each Version 11 sample project demonstrates, which source files to open and what to expect when you run it. The examples cover creating Sites and Networks, reading input settings, working with volume scenarios and reading results.

Download sample projects (ZIP)

SIDRA INTERSECTION 11.0.4. All C#, C++ and Python sample source projects in one ZIP.

C#, C++ and Python run the same ten examples. Pick the language that suits your stack, not the one with the widest coverage: the coverage is identical. The example names, the run order and the project files produced are the same in all three.

New to the API? Start with a short walkthrough to open an existing project and analyse its Sites, then return here for a larger example.

Inside the sample collection

The archive contains source code and a Visual Studio solution, SIAPISamples.sln. It also includes one project file, SampleProjectFiles/APIAssignTest2.sipx, which example 10 opens. The other examples create every project file they need, so you do not have to supply one.

Each program runs these ten examples in order:

# Example Project file it creates or reads
1 Freeway diamond interchange creates APITest.sipx
2 Read lane disciplines reads APITest.sipx
3 Read priorities data reads APITest.sipx
4 Signalised Site creates Signals.sipx
5 Roundabout, explicit lane disciplines creates Roundabout.sipx
6 Roundabout, default lane disciplines creates Roundabout2.sipx
7 Additional Site types creates NewTypeSites.sipx
8 Volume Bins and Scenarios creates VolumeBinTest.sipx
9 SIDRA ASSIGN, built from code creates APIAssignTest1.sipx
10 SIDRA ASSIGN, added to a supplied project copies and updates APIAssignTest2.sipx, and writes results to CSV

Example 1 runs first because examples 2 and 3 read the project it saves.

How each project is laid out

Every language uses the same three layers, so a routine you find in one language sits in the matching file in the others.

Layer C# C++ Python
Entry point: calls the ten examples in order Program.cs CppSample.cpp PythonSample.py
Examples 1 to 8 SIAPITest.cs SIAPITest.cpp SIAPITest.py
Examples 9 and 10 (SIDRA ASSIGN) AssignTest1.cs, AssignTest2.cs AssignTest1.cpp, AssignTest2.cpp AssignTest1.py, AssignTest2.py
Shared helpers: lane disciplines, processing, diagnostics, results reading Utilities.cs Utilities.cpp Utilities.py
Connecting to the API wrapper LB_SI11API.dll CppSIAPI.cpp PySIAPI.py

There is no VB.NET project in this ZIP. See C# / VB.NET setup for the shared wrapper.

Before you run

  1. Install and license SIDRA INTERSECTION 11 on 64-bit Windows. Follow Getting started for the runtime requirements.
  2. Download the sample ZIP using the button above and extract it into a working folder.
  3. Choose a language using the instructions below, then build and run.

Where the project files are written

Each program creates a Projects folder and writes its .sipx files there. For C# and C++ this folder sits beside the built executable; for Python it sits in the folder you run the script from. The folder is created for you, so there is nothing to set up and no paths to edit in the source. Example 10 works on a copy of the supplied APIAssignTest2.sipx, written to Projects, so the file in the ZIP is not changed.

The programs run all ten examples in sequence

Running the program end to end creates eight project files under Projects. To study one example on its own, edit the calls in Main(), _tmain() or PythonSample.Test(). Keep the interchange example first if you also run the lane disciplines or priorities examples: both read its APITest.sipx file.

Running unattended

Each program waits for a keypress before exiting so the console stays readable. Pass --no-pause to skip the wait when running from a script or a build pipeline. The wait is also skipped automatically when input is redirected or piped.

Open CSharpSample/CSharpSample.csproj in Visual Studio and select an x64 configuration. It targets net8.0-windows and references LB_SI11API.dll; the ZIP includes the wrapper and its .deps.json in the C# project folder. Start reading at Main() in Program.cs, which lists the examples in run order, then open SIAPITest.cs for the example implementations. Build and run.

Open CppSample/CppSample.vcxproj in Visual Studio and select x64. The supplied project uses the v143 C++ toolset and ATL. CppSIAPI.h imports the type library by its GUID, so there is no path to check. Start reading at _tmain() in CppSample.cpp for the run order, then open SIAPITest.cpp for the example implementations. Build and run.

Use 64-bit Python and install pythonnet, as explained in the Python walkthrough. PySIAPI.py finds your SIDRA INTERSECTION 11 installation from the Windows registry and loads the .NET runtime for you, so there is nothing to configure.

Run the script from the PythonSample folder:

python PythonSample.py

You do not need to supply a project file. The first example creates Projects/APITest.sipx, which the next two read. Example 10 copies APIAssignTest2.sipx from the SampleProjectFiles folder beside PythonSample, which is another reason to run the script from the PythonSample folder.

Build a freeway diamond interchange

Create two signalised Sites, 209W and 209E, connect them into a Network named Freeway Diamond Interchange, analyse it and read the results. Use this example to follow the complete path from individual Site geometry to Network analysis and output.

  • Languages: C#, C++ and Python.
  • Find it: CreateFreewayDiamondInterchangeNetwork() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: Site geometry, volumes and signal timing defined in the source.
  • Result: Projects/APITest.sipx, containing the two Sites and their Network, with results and processing status printed to the console.

Follow these functions in order:

  1. CreateSite209W() and CreateSite209E() create the two intersections, including lanes, movement classes, volumes and phasing.
  2. CreateNetwork() adds the Sites to the Network, connects their legs, creates a Common Control Group with phasing, and adds a route.
  3. ProcessNetwork() runs the Network analysis and reports its status.
  4. Each Network Site's results are then read and printed, using the shared helpers described under reading results.
  5. AddMoreRoute() adds a reverse-direction route and processes route results after the initial Network analysis.

The saved project is the input for the lane disciplines and priorities examples. Read alongside the Network API reference.

Read lane disciplines and priorities

Inspect the movement rules stored in an existing project: which vehicle movements can use each approach lane, and which vehicle or pedestrian movements oppose a vehicle movement.

  • Languages: C#, C++ and Python.
  • Find them: PrintLaneDisciplines() and PrintPrioritiesData() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: Projects/APITest.sipx, created by the interchange example. Both routines read the Sites in its first Site folder.
  • Result: lane discipline and opposing movement information printed to the console. Both routines close the project without saving.

These examples read input settings. For calculated flows, capacities and degree of saturation, see reading results.

Create a signalised Site

Build a signalised intersection from code, process it and print its results. This is a useful starting point for understanding how geometry, traffic volumes and signal timing fit together in a Site.

  • Languages: C#, C++ and Python.
  • Find it: CreateSignalsSite() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: geometry, volumes and timing values defined in the source.
  • Result: Projects/Signals.sipx, containing the Site, with results and processing status or diagnostic messages in the console.

The example adds legs, approach and exit lanes, an island and lane disciplines. It updates the geometry, enters vehicle and pedestrian volumes, sets opposing pedestrian movements, creates a signal phase sequence, processes the Site and reads its results. It also prints the phasing and timing inputs and results, using PrintPhasingAndTimingInputOutputData() in the Utilities file for your language.

Read alongside the Site API reference.

Create roundabouts

Compare two ways of specifying which movements can use each approach lane. Both examples build roundabout geometry, add traffic volumes and staged pedestrian crossings, and process the Site.

  • Languages: C#, C++ and Python.
  • Find them: CreateRoundaboutSite() and CreateRoundaboutSite2() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: roundabout geometry and traffic data defined in the source.
  • Results: Projects/Roundabout.sipx and Projects/Roundabout2.sipx, plus processing status or diagnostics in the console.

The first example sets lane disciplines explicitly. The second uses SetDefaultLaneDisciplines() to assign them from the geometry. This is a helper implemented in the sample code, not a method on the SIDRA Site API; you will find it in the Utilities file for your language.

Look for the splitter islands, roundabout leg parameters and the UpdateGeometryData() call before movement data is accessed.

Create additional Site types

Explore AddSiteWithGeometry() to create Sites with predefined geometry, including interchange, pedestrian crossing, arterial and freeway types. The example also creates a turbo roundabout, supplies its traffic volumes and staged pedestrian crossing data, and processes that Site.

  • Languages: C#, C++ and Python.
  • Find it: CreateNewTypeSites() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: Site type choices and traffic data defined in the source.
  • Result: Projects/NewTypeSites.sipx, containing Sites for type values 5 through 12 and the turbo roundabout (type 13). Only the turbo roundabout is processed by this routine.

See AddSiteWithGeometry for the Site type values and geometry options.

Work with Volume Bins and Scenarios

Keep traffic volume data in reusable Site Volume Bins, link them to Sites through Site Scenarios, and choose the Site Scenario used by each Site in a Network Scenario.

  • Languages: C#, C++ and Python.
  • Find it: CreateVolumeBinAndScenarios() in SIAPITest.cs, SIAPITest.cpp or SIAPITest.py.
  • Input: volume data and signalised Site geometry defined in the source.
  • Result: Projects/VolumeBinTest.sipx, containing Volume Bins, Sites, a connected Network and Scenarios. The console lists Scenarios, their volume types and analysis selections, plus processing status.

The example follows four stages:

  1. Create Volume Bin folders and bins, then clone, move and remove bins. Change pedestrian volume data in one bin.
  2. Create signalised Sites and link them to bins using AddSiteScenario(). Select Scenarios for analysis and demonstrate cloning, reordering and removing them.
  3. Create a Network and a Network Scenario. Choose a Site Scenario for each Network Site, then add another Site and change its Scenario link.
  4. Clone, reorder and remove Network Scenarios, process the Network and save the project.

For the underlying objects, see Site Volume Bin, Site Scenario and Network Scenario.

Set up SIDRA ASSIGN networks

Build the demand for SIDRA ASSIGN, create an Assign Network from a Basic Network, process it and read the assignment results. These two examples need SIDRA INTERSECTION 11.0.4 or later.

  • Languages: C#, C++ and Python.
  • Find them: CreateAssignVolumeBinAndAssignNetwork() in AssignTest1 and RunAssignScenariosAndWriteResults() in AssignTest2 (.cs, .cpp or .py).
  • Input: the first example defines everything in the source. The second opens APIAssignTest2.sipx, supplied in the ZIP, which already holds a Basic Network of three Sites.
  • Results: Projects/APIAssignTest1.sipx and Projects/APIAssignTest2.sipx, with the iteration counts and the duality gap printed to the console. AssignTest1 also prints, for one O-D pair, the flow and degree of saturation on each route. AssignTest2 also writes its O-D, Movement Class, route and convergence results to CSV files in Projects. The files are APIAssignTest2_OD.csv, APIAssignTest2_OD_by_mc.csv, APIAssignTest2_Routes.csv, APIAssignTest2_Routes_by_mc.csv and APIAssignTest2_Convergence.csv. The convergence file has only the last three steps of each run, because that is all the output keeps.

The first example creates two roundabouts and a Basic Network that connects them. It then creates an Assign Volume Bin with four zones and one O-D volume set, including volumes for a User Class, creates the Assign Network and connects each zone to a leg.

The second adds an Assign Volume Bin with three zones and three O-D volume sets, each with a generation growth rate. It creates the Assign Network and adds a second Assign Scenario that uses the third volume set. It then sets the assignment method, runs each Assign Scenario in turn and writes the results to CSV files.

Look for AddAssignNetwork(), which creates the Assign Network's zones from the bin and adds the first Assign Scenario for you, and AddAssignSchemeZoneConnection(), which connects each zone to a leg. AssignTest2 also sets the assignment method and reads O-D travel time, cost, fuel and emissions. For what each result means, see SIDRA ASSIGN.

How the examples read results

Reading results is shared work, not a separate example. The interchange and signalised Site examples both call three helpers after processing, and those helpers live in the Utilities file for each language. The signalised Site example also calls a fourth, for phasing and timing. They print far more than the two summary values shown in the short website walkthroughs.

Helper Results it reads
PrintIntersectionOutput() Vehicle, pedestrian and person travel speeds and demand flows
PrintMovementOutput() Leg degree of saturation; movement IDs, turns, flows, heavy vehicle percentages and degree of saturation
PrintLaneOutput() Lane flows, heavy vehicle percentages, capacity and degree of saturation
PrintPhasingAndTimingInputOutputData() Phasing and timing inputs and results (signalised Site example only)

To read results from a project of your own, call the same helpers against a Site and its Outputset. For the results hierarchy, see the Outputset API reference.

Version and coverage

This guide describes the SIDRA INTERSECTION 11.0.4 sample ZIP of October 2026. The examples above are identified from its source code; successful execution still depends on your installed version, licence and local setup.

For SIDRA INTERSECTION 11.0.3, select 11.0.3 in the version selector. For earlier product versions, use Previous versions.