Copy and paste models across vensim files?

Use this forum to post Vensim related questions.
Post Reply
luzi
Junior Member
Posts: 5
Joined: Thu Nov 05, 2020 9:20 am
Vensim version: DSS

Copy and paste models across vensim files?

Post by luzi »

It is possible to copy and paste models (or fragments of them) within a single vensim mdl file. It then asks for some pre- or postfix, and it nicely adjusts all formulas etc. So far, so good.

But: we could not figure out how to copy and paste model fragments from one vensim mdl file to another.

:shock: What are we missing?
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Copy and paste models across vensim files?

Post by Administrator »

Make sure you have both models open and you should be able to copy/paste. Check Tools->Options->Settings (or preferences->Settings) and make sure "Close active model on open/new" is not ticked. That will allow you to have both models open and copy/paste between them.

Or you could use the new sub-models capability and link the models together.......
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
luzi
Junior Member
Posts: 5
Joined: Thu Nov 05, 2020 9:20 am
Vensim version: DSS

Re: Copy and paste models across vensim files?

Post by luzi »

Did you try this?

I am running Vensim DSS, Version 8.0.4 Double Precision x64.

I open two separate mdl files in two separate windows.

I create a stock ("level"), and add an inflow ("rate") in one file.

I select it all, copy it (CTRL-C).

I switch over to the other window.

And - nothing!

CTRL-V does nothing, and in the "Edit" menu, the "Paste" option is greyed out.

Can you do all these steps and actually paste the piece into the new file?
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Copy and paste models across vensim files?

Post by tomfid »

When you say, "in two separate windows," it sounds like you have two distinct instances of Vensim running.

What you want is a single instance of Vensim with two models open. That's why you need the "Close Active Model" setting unchecked.

Open Model A any way you want, then use File>Open to open Model B into the same Vensim instance. Then you can use the Build window icon in the toolbar to toggle between them, and copy-paste works.

At present you need to be using the old gui for this to work, it appears. (Tools>Switch to Old Sketch, though I don't think it's relevant in your version.)
luzi
Junior Member
Posts: 5
Joined: Thu Nov 05, 2020 9:20 am
Vensim version: DSS

Re: Copy and paste models across vensim files?

Post by luzi »

Wow, Tom! You just made my day!

That is definitely not obvious or evident. I will make sure to share this with all my desperate colleagues!

Thanks a lot - case solved.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Copy and paste models across vensim files?

Post by tomfid »

Great. I guess we need to make it clearer in the Help.
luzi
Junior Member
Posts: 5
Joined: Thu Nov 05, 2020 9:20 am
Vensim version: DSS

Re: Copy and paste models across vensim files?

Post by luzi »

That's one way to look at it, Tom.

As a programmer, I often have the choice between coercing the user to adapt to what I programmed, or to improve my code and adapt it to what the user expects.

In this case, I have a hard time understanding why it wouldn't be possible to improve the clipboard management in a way that elements could be transferred across Vensim instances...

Any insights would be interesting, because I run across many quirks in Vensim where I wonder why this wouldn't be made more user-friendly.
Post Reply