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
1answer
Staff Answer
Jan 22, 2019 - 05:51 AM
Hello Uriel
You can not edit or add global substitutions from the Python interface. This feature is on my list of enhancements for PSCAD Version 5 .
George Wai
PSCAD Support
support@pscad.com
-
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment