How can I 1. add an Ansys Workbench integration node to the Ansys optiSLang project 2. register defined parameter and responses
That's possible in few easy steps:
from ansys.optislang.core import Optislang from ansys.optislang.core.nodes import IntegrationNode, DesignFlow import ansys.optislang.core.node_types as node_types
osl = Optislang(ini_timeout=240)
root_system = osl.application.project.root_system wb_node: IntegrationNode = root_system.create_node( name='WB', type_=node_types.awb2_plugin, design_flow=DesignFlow.RECEIVE_SEND ) wb_node.set_property( name="WorkbenchProjectFile", value={ "path": { "base_path_mode": {"value": "ABSOLUTE_PATH"}, "split_path": {"head": "", "tail": "coupled_function.wbpz"}, } }, )
Example can be found at Coupled Function optiSLang Tutorial example 4. register parameter and responses
wb_node.load() wb_node.register_locations_as_parameter() wb_node.register_locations_as_response()
osl.application.project.start(wait_for_finished=True)
In relation to this discussion, I’d like to know where I can find a list of the adjustable properties of each node type. In my case, I want to edit the run options inside the wb_node. I’ve done it in optiSLang, and now I want to be able to do it in PyOptiSLang.
Hi @Leire,
there are basically two ways of getting those information: 1. you can extract the json object with python_node.get_properties() 2. open your created project with Ansys optiSLang GUI and open Project overview:
python_node.get_properties()