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. All C#, C++ and Python sample source projects in one ZIP.
C#, C++ and Python run the same eight 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 does not include ready-made .sipx files. The examples
create every project file they need, so you do not have to supply one.
Each program runs these eight 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 CreateNewTypeSites.sipx |
| 8 | Volume Bins and Scenarios | creates VolumeBinTest.sipx |
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 eight examples in order | Program.cs |
CppSample.cpp |
PythonSample.py |
| The eight examples | SIAPITest.cs |
SIAPITest.cpp |
SIAPITest.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¶
- Install and license SIDRA INTERSECTION 11 on 64-bit Windows. Follow Getting started for the runtime requirements.
- Download the sample ZIP using the button above and extract it into a working folder.
- 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.
The programs run all eight examples in sequence
Running the program end to end creates six 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:
You do not need to supply a project file. The first example creates
Projects/APITest.sipx, which the next two read.
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()inSIAPITest.cs,SIAPITest.cpporSIAPITest.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:
CreateSite209W()andCreateSite209E()create the two intersections, including lanes, movement classes, volumes and phasing.CreateNetwork()adds the Sites to the Network, connects their legs, creates a Common Control Group with phasing, and adds a route.ProcessNetwork()runs the Network analysis and reports its status.- Each Network Site's results are then read and printed, using the shared helpers described under reading results.
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:
ReadLaneDisciplines()andReadPrioritiesData()inSIAPITest.cs,SIAPITest.cpporSIAPITest.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()inSIAPITest.cs,SIAPITest.cpporSIAPITest.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.
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()andCreateRoundaboutSite2()inSIAPITest.cs,SIAPITest.cpporSIAPITest.py. - Input: roundabout geometry and traffic data defined in the source.
- Results:
Projects/Roundabout.sipxandProjects/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:
CreateNewTypeSite()inSIAPITest.cs,SIAPITest.cpporSIAPITest.py. - Input: Site type choices and traffic data defined in the source.
- Result:
Projects/CreateNewTypeSites.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()inSIAPITest.cs,SIAPITest.cpporSIAPITest.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:
- Create Volume Bin folders and bins, then clone, move and remove bins. Change pedestrian volume data in one bin.
- Create signalised Sites and link them to bins using
AddSiteScenario(). Select Scenarios for analysis and demonstrate cloning, reordering and removing them. - Create a Network and a Network Scenario. Choose a Site Scenario for each Network Site, then add another Site and change its Scenario link.
- 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.
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. They print far more
than the two summary values shown in the short website walkthroughs.
| Helper | Results it reads |
|---|---|
ReadIntersectionOutput() |
Vehicle, pedestrian and person travel speeds and demand flows |
ReadMovementOutput() |
Leg degree of saturation; movement IDs, turns, flows, heavy vehicle percentages and degree of saturation |
ReadLaneOutput() |
Lane flows, heavy vehicle percentages, capacity and degree of saturation |
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 public Version 11 ZIP reviewed on 15 September 2026. The examples above are identified from its source code; successful execution still depends on your installed version, licence and local setup.
The reviewed ZIP has no separate Assign Network or Assign Volume Bin example. These data will be available in the SIDRA INTERSECTION 11.0.4 API, and new examples for them will be provided. If you need an example for these tasks before then, contact SIDRA SOLUTIONS. For earlier product versions, use Previous versions.