SysML2ProjectManager#

class ansys.sam.sysml2.builder.sysml2_project_manager.SysML2ProjectManager(connector: ansys.sam.sysml2.api.sysml2_api_connector.SysML2APIConnector)#

Provides the director class for loading and managing projects.

Overview#

get_projects

Get all projects of the connected user.

get_sysml_project

Get a SysML project with its ID from the API and map it in a Python object.

get_scripting_project

Get a scripting project with its ID from the API and map it in a Python object.

create_sysml_project

Create a new project on the server and return it as a SysML Project.

create_scripting_project

Create a new project on the server and return it as a Scripting Project.

delete_project

Delete the project with the given ID.

update_project

Update the project with the given ID.

Import detail#

from ansys.sam.sysml2.builder.sysml2_project_manager import SysML2ProjectManager

Method detail#

SysML2ProjectManager.get_projects() List[dict]#

Get all projects of the connected user.

Returns:
list of dict

List of all project records.

SysML2ProjectManager.get_sysml_project(project_id: str) ansys.sam.sysml2.classes.project.Project#

Get a SysML project with its ID from the API and map it in a Python object.

SysML2ProjectManager.get_scripting_project(project_id: str) ansys.sam.sysml2.classes.scripting_project.ScriptingProject#

Get a scripting project with its ID from the API and map it in a Python object.

SysML2ProjectManager.create_sysml_project(name: str, description: str = 'Project description') ansys.sam.sysml2.classes.project.Project#

Create a new project on the server and return it as a SysML Project.

Parameters:
namestr

Name of the project.

descriptionstr, default: "Project description"

Description of the project.

Returns:
Project

The newly created project, fully built from the API.

SysML2ProjectManager.create_scripting_project(name: str, description: str = 'Project description') ansys.sam.sysml2.classes.scripting_project.ScriptingProject#

Create a new project on the server and return it as a Scripting Project.

Parameters:
namestr

Name of the project.

descriptionstr, default: "Project description"

Description of the project.

Returns:
ScriptingProject

The newly created project, fully built from the API.

SysML2ProjectManager.delete_project(project_id: str) dict#

Delete the project with the given ID.

Parameters:
project_idstr

ID of the project to delete.

Returns:
dict

Confirmation containing @type and @id of the deleted project.

SysML2ProjectManager.update_project(project_id: str, name: str = None, description: str = None) dict#

Update the project with the given ID.

Parameters:
project_idstr

ID of the project to update.

namestr, optional

New name for the project.

descriptionstr, optional

New description for the project.

Returns:
dict

Updated project record.