Manage projects#

The SysML2ProjectManager class provides methods for managing projects on the server: listing, creating, updating, and deleting them.

To use these methods, you need an instance of the SysML2ProjectManager (see Use a connector).

List projects#

Retrieve all projects accessible to the connected user:

projects = project_manager.get_projects()
for p in projects:
    print(f"{p['name']} (id: {p['@id']})")

Create a project#

Create a new project on the server. The project is automatically built and returned as a Python object, ready to use.

Two methods are available depending on the approach:

project = project_manager.create_scripting_project(
    name="My New Project",
    description="A project created via PySAM SysML2",
)
project = project_manager.create_sysml_project(
    name="My New Project",
    description="A project created via PySAM SysML2",
)

Both methods create the project on the server and return a fully loaded project object, similar to calling get_scripting_project() or get_sysml_project() on an existing project.

Update a project#

Rename a project or change its description:

updated = project_manager.update_project(
    project_id="<Project ID>",
    name="My Renamed Project",
    description="Updated description",
)

Both name and description parameters are optional. Only the provided fields are updated.

Delete a project#

Delete a project from the server:

deleted = project_manager.delete_project(project_id="<Project ID>")

Warning

Deleting a project is irreversible. All data associated with the project is permanently removed.

Previous step

Dynamic vs static approaches

Dynamic versus static approaches
Next step

Load a model

Load a model