ScriptingProject#

class ansys.sam.sysml2.classes.scripting_project.ScriptingProject#

Scripting project interface for users.

Overview#

get_id

Get the project ID.

get_name

Get the project name.

get_root

Get a list of root packages.

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.

Import detail#

from ansys.sam.sysml2.classes.scripting_project import ScriptingProject

Method detail#

ScriptingProject.get_id() str#

Get the project ID.

ScriptingProject.get_name() str#

Get the project name.

ScriptingProject.get_root() List[ansys.sam.sysml2.classes.sysml_element.SysMLElement]#

Get a list of root packages.

ScriptingProject.get_root_package() ansys.sam.sysml2.classes.sysml_element.SysMLElement#

Get the root package.

ScriptingProject.find_element_by_id(element_id: str) ansys.sam.sysml2.classes.sysml_element.SysMLElement#

Find an element by ID.

Parameters:
element_idstr

Element ID.

Returns:
SysMLElement

Element retrieved.

ScriptingProject.find_elements_by_name(elements_name: str) List[ansys.sam.sysml2.classes.sysml_element.SysMLElement]#

Find all elements by name.

Parameters:
elements_namestr

Name of elements.

Returns:
List[SysMLElement]

List of elements retrieved.

ScriptingProject.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.

ScriptingProject.stop_transactional_mode()#

Stop the current transaction.

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