Getting started¶
Use the SIDRA INTERSECTION API to create and update projects, work with Site and Network data, run analyses, and read results from your own applications. This page gets a working "hello world" running against it.
Windows 64-bit · .NET 8 · C# / VB.NET · C++ · Python
Prerequisites¶
- SIDRA INTERSECTION 11.0.3 installed and licensed (the API ships with the product). The
installer registers the COM type library (
SIDRASolutions.SI.API.tlb) and the .NET COM host (SIDRASolutions.SI.API.comhost.dll). - A 64-bit host process. The API is
net8.0-windowsx64-only and cannot be loaded into a 32-bit process. Set your project's Platform target tox64(notAnyCPU). - .NET 8 runtime present on the machine. The SIDRA INTERSECTION installer satisfies this.
Your application can check the installed copy with
ISIAPI.IsLicensed, which
returns false for an unlicensed copy. See
Licensing for licence requirements.
Supported languages¶
The API is a .NET 8 assembly for 64-bit Windows. The host process must be 64-bit in every language.
| Language | How it accesses the API |
|---|---|
| C# / VB.NET | Reference the late-binding wrapper LB_SI11API.dll, targeting net8.0-windows and x64. |
| C++ | Use the COM type library registered by the SIDRA INTERSECTION installer. |
| Python | Use Python.NET to host the .NET 8 runtime and load the API assembly directly. |
Add the reference¶
C# / VB.NET¶
The API ships with a late-binding wrapper assembly, LB_SI11API.dll, that
exposes the SIDRASolutions.SI.API types and loads the installed SIDRA
Intersection runtime at run time. Reference it directly instead of going
through COM:
- Download the Version 11 late-binding wrapper
and extract
LB_SI11API.dlland itsLB_SI11API.deps.jsoninto your project. - Add an assembly reference to it (a
<Reference Include="LB_SI11API">with a<HintPath>; see the C# sample). - Target
net8.0-windowsand x64 (notAnyCPU).
C++¶
Use the installed SIDRASolutions.SI.API.tlb type library from a 64-bit
Visual C++ project with ATL. Initialise COM on an STA thread before creating
the API object. The C++ sample includes the type-library
import, build instructions and cleanup.
Python (Python.NET)¶
Python does not go through COM. Use Python.NET
(pythonnet) to host the .NET 8 runtime and load the API assembly directly:
import os
from pythonnet import set_runtime
from clr_loader import get_coreclr
sidra = r"C:\Program Files\SIDRA SOLUTIONS\SIDRA INTERSECTION 11"
# Host the API's own .NET 8 runtime via its runtimeconfig, then load the DLL.
set_runtime(get_coreclr(
runtime_config=os.path.join(sidra, "SIDRASolutions.SI.API.runtimeconfig.json")))
import clr
clr.AddReference(os.path.join(sidra, "SIDRASolutions.SI.API.dll"))
from SIDRASolutions.SI.API import SIAPI
api = SIAPI()
See the Python sample for locating the install folder from the registry and reading results.
Open a project and read its name¶
using System;
using SIDRASolutions.SI.API;
class Program
{
[STAThread]
static void Main()
{
var api = new SIAPI();
try
{
if (!api.IsLicensed)
throw new InvalidOperationException("SIDRA INTERSECTION must be licensed.");
if (!api.OpenProject(@"C:\Samples\MyProject.sipx"))
throw new InvalidOperationException(api.LastErrorMessage);
ISIAPIProject project = api.Project;
Console.WriteLine($"Opened: {project.Name}");
Console.WriteLine($"Site folders: {project.SiteFolders.Count}");
}
finally
{
api.Close();
}
}
}
The entry interface is always ISIAPI.
Once a project is open, ISIAPI.Project returns the
ISIAPIProject wrapper which is
your gateway to Sites (intersections), Networks and analyses.
Next steps¶
- Object model: the
Project -> Site -> Leg -> Lanehierarchy. - Code samples: choose a short C#, C++ or Python walkthrough.
- Sample project guide: download the larger examples and follow their explanations and run instructions.
- Downloads: the sample ZIP, wrapper files, offline Help and workshop materials.
- Previous versions: API Help, wrappers and sample projects for SIDRA INTERSECTION 10 and 9.1.
- Troubleshooting: if the API fails to load, activate, or open your project.