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.

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, resolve_standard_libraries: bool = False, includes_derived: bool = True, includes_inherited: bool = True) → ansys.sam.sysml2.classes.project.Project#

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

Parameters:
project_idstr

ID of the project to build.

resolve_standard_librariesbool, default: False

When True, keep library elements’ references so their contents are resolved and mapped during the build.

includes_derivedbool, default: True

When True, include derived properties from the API /elements response.

includes_inheritedbool, default: True

When True, include inherited memberships and features from the API response.

Returns:
Project

The fully built SysML project.

SysML2ProjectBuilder.build_scripting_project(project_id: str, resolve_standard_libraries: bool = False, includes_derived: bool = True, includes_inherited: bool = True) → ansys.sam.sysml2.classes.project.Project#

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

Parameters:
project_idstr

ID of the project to build.

resolve_standard_librariesbool, default: False

When True, keep library elements’ references so their contents are resolved and mapped during the build.

includes_derivedbool, default: True

When True, include derived properties from the API /elements response.

includes_inheritedbool, default: True

When True, include inherited memberships and features from the API response.

Returns:
Project

The fully built dynamic project.

SysML2ProjectBuilder.extract_root_and_check_names(project: ansys.sam.sysml2.classes.project.Project, root_ids: set[str])#

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

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

Reload the project and update all its elements.

Parameters:
modification_observerModificationObserver

Observer instance.

projectProject

Project instance to reload.