Practical Way to Rename Variables after Copy-Pasting Structures?

Use this forum to post Vensim related questions.
Post Reply
Nub_User
Senior Member
Posts: 51
Joined: Mon Aug 16, 2021 11:55 pm
Vensim version: PLE

Practical Way to Rename Variables after Copy-Pasting Structures?

Post by Nub_User »

Hi everyone,

I’m working on a Vensim model where I’ve repeated the same structure (containing 25 variables) seven times. Each structure has identical architecture, but the variables have distinct names for each repetition.

When I copy-pasted the structure, Vensim automatically renamed the variables by appending an ascending number to their names. Now, I need to rename these variables to match the specific naming conventions I’m using for each structure.

My question is:
Is there a more practical way to rename variables in Vensim without manually double-clicking each variable in the sketch view and editing them with the mouse and keyboard? I’d like to avoid repetitive and time-consuming manual work.

Thanks in advance for your help!
aliakhavan89
Senior Member
Posts: 162
Joined: Sun Oct 21, 2018 7:09 am
Vensim version: DSS

Re: Practical Way to Rename Variables after Copy-Pasting Structures?

Post by aliakhavan89 »

You can replace the numerical sequence with a manually defined suffix when pasting the variables, if this is what you want.
Screenshot 2025-01-21 at 5.13.00 PM.png
Screenshot 2025-01-21 at 5.13.00 PM.png (110.85 KiB) Viewed 1445 times
Administrator
Super Administrator
Posts: 4751
Joined: Wed Mar 05, 2003 3:10 am

Re: Practical Way to Rename Variables after Copy-Pasting Structures?

Post by Administrator »

If you are replicating seven times, using subscripts/arrays (only in Vensim Pro/DSS) would probably be better.
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
Nub_User
Senior Member
Posts: 51
Joined: Mon Aug 16, 2021 11:55 pm
Vensim version: PLE

Re: Practical Way to Rename Variables after Copy-Pasting Structures?

Post by Nub_User »

Is there a way to edit the names of variables pasted from a list, a text file, or a similar method?
Administrator
Super Administrator
Posts: 4751
Joined: Wed Mar 05, 2003 3:10 am

Re: Practical Way to Rename Variables after Copy-Pasting Structures?

Post by Administrator »

Not easily. You can edit the MDL file in a text editor, but you would need to do a find/replace all.
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