Hi
By default, the Python objects are not connected, for security purposes. It is possible to activate an option to automatically connect the Python objects. This is mandatory to be able to use Python objects in a Design Point experiment.
The option is: activate the Connect/Run Python Code Objects when Mechanical is Launched preference contained in the Mechanical category of the Workbench Options dialog (Tools > Options > Mechanical):
See this page of the help for further information: https://ansysproducthelpqa.win.ansys.com/account/secured?returnurl=/Views/Secured/corp/v231/en/wb_sim/ds_python_code.html
In the future should you have any scripting related questions you can also post here:
https://discuss.ansys.com/categories/engineering-simulation
Thank you
Erik