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

Extract root elements and resolve inherited names in a single pass.

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)#

Extract root elements and resolve inherited names in a single pass.

Both operations are combined into one iteration over the project environment to avoid looping twice.

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.classes.project.Project | ansys.sam.sysml2.classes.scripting_project.ScriptingProject)#

Reload the project and update all its elements.

Parameters:
modification_observerModificationObserver

Observer instance.

projectProject | ScriptingProject

Project instance to reload.