SIDRA API¶
Type ISIAPI · Interface
Namespace SIDRASolutions.SI.API
Assembly SIDRASolutions.SI.API.dll
COM CLSID 9C0B1932-3E16-4F86-9365-2E5F752328FC
SIDRA INTERSECTION API wrapper interface.
Declaration¶
Members¶
Properties
| Property | Type | Summary |
|---|---|---|
| Project | ISIAPIProject |
Current open SIDRA INTERSECTION project. |
| IsLicensed | bool |
Indicates whether the installed version of SIDRA INTERSECTION is licensed. |
| LastErrorMessage | string |
|
| IntPtrSize | int |
|
| SourceAppName | string |
The name of the application that calls SIAPI. It will be saved in Site, Network, Site Volume Bin and Assign Volume Bin's Created_by_source_app and Modified_by_source_app. |
Methods
| Method | Returns | Summary |
|---|---|---|
| OpenProject(string) | bool |
Opens a SIDRA INTERSECTION Project. |
| CloseProject() | bool |
Closes the SIDRA INTERSECTION Project and saves it. |
| Close() | bool |
Closes API: saves and closes the project if it is still open, releases the licence and frees resources. |
| CreateAndOpenProject(string, string) | bool |
Creates and opens a SIDRA INTERSECTION Project. |
| SaveProject() | bool |
Save the SIDRA INTERSECTION Project. |
| CloseProjectWithoutSaving() | bool |
Close the SIDRA INTERSECTION Project without saving it. |
Get an instance¶
import os
import winreg
from pythonnet import set_runtime
from clr_loader import get_coreclr
def sidra_install_path():
"""Read the SIDRA Intersection install folder from the registry."""
key = r"SOFTWARE\SIDRA SOLUTIONS\SIDRA INTERSECTION 11"
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key) as k:
return winreg.QueryValueEx(k, "InstallLocation")[0]
sidra = sidra_install_path()
# Host the API's own .NET 8 runtime (via its runtimeconfig), then load the DLL.
# This must happen before the first `import clr`.
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()
Properties¶
Project¶
Current open SIDRA INTERSECTION project.
Type ISIAPIProject
Value
If no project is open NULL is returned.
Code samples
IsLicensed¶
Indicates whether the installed version of SIDRA INTERSECTION is licensed.
Type bool
Code samples
LastErrorMessage¶
Type string
Code samples
IntPtrSize¶
Type int
Code samples
SourceAppName¶
The name of the application that calls SIAPI. It will be saved in Site, Network, Site Volume Bin and Assign Volume Bin's Created_by_source_app and Modified_by_source_app.
Type string
Code samples
Methods¶
OpenProject(string)¶
Opens a SIDRA INTERSECTION Project.
Parameters
| Name | Type | Description |
|---|---|---|
filename |
string |
Path of the SIDRA INTERSECTION Project file to open |
Returns bool
Code samples
CloseProject()¶
Closes the SIDRA INTERSECTION Project and saves it.
Returns bool
Code samples
Close()¶
Closes API: saves and closes the project if it is still open, releases the licence and frees resources.
Returns bool
Code samples
CreateAndOpenProject(string, string)¶
Creates and opens a SIDRA INTERSECTION Project.
Parameters
| Name | Type | Description |
|---|---|---|
filename |
string |
Path of the SIDRA INTERSECTION Project file to open |
newProjectName |
string |
The Project name |
Returns bool
Code samples
SaveProject()¶
Save the SIDRA INTERSECTION Project.
Returns bool
Code samples
CloseProjectWithoutSaving()¶
Close the SIDRA INTERSECTION Project without saving it.
Returns bool