Vector variables DLL-Python

Use this forum to post Vensim related questions.
Post Reply
valen0205
Junior Member
Posts: 3
Joined: Tue Jul 30, 2024 10:53 pm
Vensim version: DSS

Vector variables DLL-Python

Post by valen0205 »

Hello!

I am currently working on a project where I need to assign names to the indexes of vector variables in a Vensim model using the Vensim DLL from Python. I have been able to set and get scalar variables successfully, but I am encountering difficulties with vector variables, particularly with assigning names to their indexes programmatically.

How can I assign names to the indexes of vector variables using the Vensim DLL and Python?
Are there any specific commands or functions in the Vensim DLL that facilitate this process?

Any examples or detailed documentation references would be greatly appreciated
Thank you in advance for your help!
tomfid
Administrator
Posts: 3856
Joined: Wed May 24, 2006 4:54 am

Re: Vector variables DLL-Python

Post by tomfid »

You can't change variable names in Vensim via the .dll, and this applies equally to subscripts and stock-flow-aux-data. Your Python code will need to reference variables with subscripts as they exist in the model.
tomfid
Administrator
Posts: 3856
Joined: Wed May 24, 2006 4:54 am

Re: Vector variables DLL-Python

Post by tomfid »

If you tell us what you need to accomplish, we might be able to suggest a workaround.
valen0205
Junior Member
Posts: 3
Joined: Tue Jul 30, 2024 10:53 pm
Vensim version: DSS

Re: Vector variables DLL-Python

Post by valen0205 »

Sorry, I meant was how can I call an existing variable that is a vector?
How can I call the indexes of it?
Administrator
Super Administrator
Posts: 4667
Joined: Wed Mar 05, 2003 3:10 am

Re: Vector variables DLL-Python

Post by Administrator »

valen0205 wrote: Wed Aug 14, 2024 4:04 pm Sorry, I meant was how can I call an existing variable that is a vector?
How can I call the indexes of it?
I don't understand what you are trying to do.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Post Reply