ScadeOne app#

The ScadeOne “app” is the Python class that allows you to interact with Scade One projects.

The ansys.scadeone.core module must be referenced by scripts using PyScadeOne. It exposes the ScadeOne class representing a Scade One instance.

An instance of the ScadeOne class gives access to project loading and model-related activities as shown in the next figure:

../_images/scadeone.svg

ScadeOne class hierarchy#

class ansys.scadeone.core.ScadeOne(install_dir: str | Path | None = None)#

Bases: IScadeOne

Scade One application API.

close()#

Close application, releasing any connection.

load_project(storage: ProjectStorage | str | Path) Project | None#

Load a Scade One project.

Parameters:
storageUnion[ProjectAsset, Path, str]

Storage containing project data.

Returns:
Project|None

Project object, or None if file does not exist.

subst_in_path(path: str) str#

Substitute $(SCADE_ONE_LIBRARIES_DIR) in path.

if ScadeOne.install_dir is None, no change is made.

property install_dir: Path | None#

Installation directory as given when creating the ScadeOne instance.

property projects: List[Project]#

Return the loaded projects.

Returns:
List[Project]

Loaded projects.

property version: str#

API version.