ScriptingProjectImpl#

class ansys.sam.sysml2.builder.classes.scripting_project_impl.ScriptingProjectImpl(project_id: str, name: str)#

Bases: ansys.sam.sysml2.classes.scripting_project.ScriptingProject

Provides a private class for scripting project building.

Overview#

add_element

Add an element to the project environment.

update_unresolved_fields

Update all unresolved fields.

get_root

Get a list of root packages.

get_id

Get the project ID.

get_root_package

Get the root package.

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.scripting_project_impl import ScriptingProjectImpl

Method detail#

ScriptingProjectImpl.add_element(element: ansys.sam.sysml2.classes.sysml_element.SysMLElement)#

Add an element to the project environment.

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

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

Get a list of root packages.

Returns:
List[SysMLElement]

List of root packages.

ScriptingProjectImpl.get_id() str#

Get the project ID.

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

Get the root package.

ScriptingProjectImpl.get_name() str#

Get the project name.

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

Find an element by its ID.

Parameters:
element_idstr

Element ID.

Returns:
SysMLElement

SysMLElement retrieved.

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

Find all elements by name.

Parameters:
element_namestr

Name of elements.

Returns:
List[SysMLElement]

List of elements retrieved.

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

ScriptingProjectImpl.stop_transactional_mode()#

Stop the current transaction.

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