ProjectImpl#

class ansys.sam.sysml2.builder.classes.project_impl.ProjectImpl(project_id: str, name: str)#

Bases: ansys.sam.sysml2.classes.project.Project

Provides a private class for project building.

Overview#

add_element

Add an element to the project environment.

update_unresolved_fields

Update all unresolved fields.

get_id

Get the project ID.

get_root_package

Get the first package owned by the root Namespace.

get_root_packages

Get the packages owned by the root Namespace.

get_libraries_packages

Get the libraries packages.

get_name

Get the project name.

find_element_by_id

Find an element by its 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.

Import detail#

from ansys.sam.sysml2.builder.classes.project_impl import ProjectImpl

Method detail#

ProjectImpl.add_element(element: ansys.sam.sysml2.meta_model.element.Element)#

Add an element to the project environment.

ProjectImpl.update_unresolved_fields(unresolved_fields: list[ansys.sam.sysml2.classes.unresolved_field.UnresolvedField])#

Update all unresolved fields.

Parameters:
unresolved_fieldsList[UnresolvedField]

List of all new fields.

ProjectImpl.get_id() → str#

Get the project ID.

ProjectImpl.get_root_package() → ansys.sam.sysml2.meta_model.package.Package#

Get the first package owned by the root Namespace.

ProjectImpl.get_root_packages() → list[ansys.sam.sysml2.meta_model.package.Package]#

Get the packages owned by the root Namespace.

ProjectImpl.get_libraries_packages() → list[ansys.sam.sysml2.meta_model.package.Package]#

Get the libraries packages.

Returns:
List[Package]

List of libraries packages.

ProjectImpl.get_name() → str#

Get the project name.

ProjectImpl.find_element_by_id(element_id: str) → ansys.sam.sysml2.meta_model.element.Element | None#

Find an element by its ID.

Parameters:
element_idstr

Element ID.

Returns:
Element

Element retrieved.

ProjectImpl.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]

List of elements retrieved.

ProjectImpl.start_transactional_mode() → None#

Start a transactional mode for model edition.

Direct model updates are suspended and every change is registered until the transaction is committed or stopped. Calculated modifications are applied only once all changes are committed.

ProjectImpl.stop_transactional_mode() → None#

Stop the current transaction.

Close the current transaction and commit all changes to the server.