Project#

class ansys.sam.sysml2.classes.project.Project#

Bases: abc.ABC

Provides the project interface for users.

Overview#

get_root

Get a list of root packages.

get_id

Get the project ID.

get_name

Get the project name.

get_root_package

Get the root package.

find_element_by_id

Find an element by ID.

find_elements_by_name

Find all elements by name.

start_transactional_mode

Start a transactional mode for model edition.

stop_transactional_mode

Stop the current transaction.

root

Get a list of root packages.

name

Get the project name.

root_package

Get the root package.

Import detail#

from ansys.sam.sysml2.classes.project import Project

Property detail#

property Project.root: List[ansys.sam.sysml2.meta_model.package.Package]#

Get a list of root packages.

property Project.name: str#

Get the project name.

property Project.root_package: ansys.sam.sysml2.meta_model.package.Package#

Get the root package.

Method detail#

abstractmethod Project.get_root() List[ansys.sam.sysml2.meta_model.package.Package]#

Get a list of root packages.

abstractmethod Project.get_id() str#

Get the project ID.

abstractmethod Project.get_name() str#

Get the project name.

abstractmethod Project.get_root_package() ansys.sam.sysml2.meta_model.package.Package#

Get the root package.

abstractmethod Project.find_element_by_id(element_id: str) ansys.sam.sysml2.meta_model.element.Element#

Find an element by ID.

Parameters:
element_idstr

Element ID.

Returns:
Element

Element retrieved.

abstractmethod Project.find_elements_by_name(element_name: str) List[ansys.sam.sysml2.meta_model.element.Element]#

Find all elements by name.

Parameters:
element_namestr

Name of elements.

Returns:
List[Element]

The list of elements retrieved

abstractmethod Project.start_transactional_mode()#

Start a transactional mode for model edition.

This method will stop direct update for the model, and register all changes until you commit or stop the transactional mode.

Warning, all calculated modifications will not be applied, until the commit of all changes.

abstractmethod Project.stop_transactional_mode()#

Stop the current transaction.

This method will close the current transaction and commit all changes to the server.