SysML2ProjectBuilder#

class ansys.sam.sysml2.builder.sysml2_project_builder.SysML2ProjectBuilder(connector: ansys.sam.sysml2.api.sysml2_api_connector.SysML2APIConnector)#

Provides the SysML2 project builder.

Overview#

build_sysml_project

Call the API with the specified project ID and build the SysML project from JSON.

build_scripting_project

Call the API with the specified project ID and build the scripting project from JSON.

extract_root_and_check_names

Parse all project elements, extract the root element, and update names.

filter_and_add_sysml_element

Filter and check root packages for SysML projects.

filter_and_add_scripting_element

Filter and check root packages for Scripting project.

update_element

Update the element with inherited elements.

clear_element

Clear all inherited elements in the element.

reload_project

Reload the project and update all its elements.

Import detail#

from ansys.sam.sysml2.builder.sysml2_project_builder import SysML2ProjectBuilder

Method detail#

SysML2ProjectBuilder.build_sysml_project(project_id: str) ansys.sam.sysml2.classes.project.Project#

Call the API with the specified project ID and build the SysML project from JSON.

SysML2ProjectBuilder.build_scripting_project(project_id: str) ansys.sam.sysml2.classes.scripting_project.ScriptingProject#

Call the API with the specified project ID and build the scripting project from JSON.

SysML2ProjectBuilder.extract_root_and_check_names(project: ansys.sam.sysml2.classes.project.Project | ansys.sam.sysml2.classes.scripting_project.ScriptingProject)#

Parse all project elements, extract the root element, and update names.

SysML2ProjectBuilder.filter_and_add_sysml_element(element: ansys.sam.sysml2.meta_model.element.Element, roots: List)#

Filter and check root packages for SysML projects.

Parameters:
elementElement

Element to check.

rootsList

List of root packages.

SysML2ProjectBuilder.filter_and_add_scripting_element(element: ansys.sam.sysml2.classes.sysml_element.SysMLElement, roots: List)#

Filter and check root packages for Scripting project.

Parameters:
elementSysMLElement

Element to check.

rootsList

List of root packages.

SysML2ProjectBuilder.update_element(element)#

Update the element with inherited elements.

Parameters:
elementSysMLElement

The element to update.

SysML2ProjectBuilder.clear_element(ignore_list, element)#

Clear all inherited elements in the element.

Parameters:
ignore_listlist

List of attributes to ignore when clearing.

elementSysMLElement

The element to clear.

SysML2ProjectBuilder.reload_project(modification_observer: ansys.sam.sysml2.observer.observer.ModificationObserver, project: ansys.sam.sysml2.builder.classes.scripting_project_impl.ScriptingProjectImpl)#

Reload the project and update all its elements.

Parameters:
modification_observerModificationObserver

Observer instance.

projectScriptingProjectImpl

Scripting project instance to reload.