how to change the global substitutions in pscad with python
Good day,
I have build a model of an electrical grid in PSCAD and I am controlling it from python with the help of the automation library. By changing some parameters of some blocks like Lines, sliders and so on, I am blocked with a problem.
In some elements of the grid the variable is changed in the GLOBAL SUBSTITUTIONS, so when I am trying to variate them from python, they do not change at all. I tryied to get the global substitutions first with the Id as follows ("length" is the vaiable I want to change):
project_name = 'grid'
project = pscad.project(project_name)
project.focus()
main = project.user_canvas('Main')
global=main.user_cmp("Id")
global.set_parameters(length=x)
then I tried to change it with the parameters of the project like:
project_name = 'grid'
project = pscad.project(project_name)
project.focus()
project.parameters(length=x)
Any of these options worked. Do you have any idea how could i have acces to these variables with python.
Thanking you in anticipation.
Kind regards
Uriel
Status:
Open Jan 21, 2019 - 05:59 AM
global substitutions, Python, Automation Library
Add New Comment