# Move views between sheets using a dictionary

**URL:** <https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715>\
**Category:** Revit\
**Created:** [January 15, 2019, 4:28pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715 "2019-01-15T16:28:15Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 15, 2019, 4:28pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/1 "2019-01-15T16:28:16Z")

</div>

Hello all,  
Following my previous post

> [@Move views between sheets](https://forum.dynamobim.com/t/move-views-between-sheets/30516):
>
> Hello all, We are trying to move views between sheets, the node Tool.PlaceViewsonExistingSheets from SteamNodes seems not to work, viewport null. Any ideas??? [Move views betwen sheets.dyn](https://forum.dynamobim.com/uploads/short-url/d6s22UP0rwiIViVLKV8QVPXBKWN.dyn) (26.2 KB)

We have a situation if we want to duplicate area views, the archilab node does not support area plans, therefore we are trying instead of duplicating the views just delete the viewports and move the views to another sheet using a dictionary.  
I am not familiar with the use of them and I hope you can give us a hand here.  
The operation that we want to excel is once the viewports are deleted we retrieve the id of the views to place them on a existing sheet.  
Somehow when we get the values from the dictionary the output is null.  
Any ideas???  
Screenshot attached and definition.  
Many thanks in advance

 ![c1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/3/23cc13f18e68b4eadd2957565efdc2af0b7ab234.jpeg) ![c2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/c/dc2d4f433453369268eb6b3f345d4a6d24a75553.jpeg)  
[41\_Move views between two sheets\_v1.dyn](https://forum.dynamobim.com/uploads/short-url/g5SBFIjuL3bFYmoNRCI5BWCHeJh.dyn) (39.4 KB)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:18pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/2 "2019-01-15T18:18:21Z")

</div>

The deleted strings are being fed as a single, comma separated string. Try using something like this:

String.Split(DeletedIds, ‘, ‘);

And feeding the output from there into the dictionary.

If that doesn’t work, try upgrading to Dynamo 2.0.2 and using the Dictionary methods there. I find them to perform better than the Lunchbox version.

---

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 15, 2019, 6:21pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/3 "2019-01-15T18:21:33Z")

</div>

I’d like not to migrate and keep all my defs on 1.3.3

As I’d like not to update all our graphs to 2.0

the inputs are separated by ; shall I tried ,

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:26pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/4 "2019-01-15T18:26:54Z")

</div>

Hard to read the separator based on the image - if it’s a ; replace the , in the codeblock with ; or use the regular String.Split node and a String node containing the ; (include the space) as the separator.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:28pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/5 "2019-01-15T18:28:23Z")

</div>

Also, I PMed you about the 1.x vs 2.x stuff, but the gist of it is that it’s time to move in from 1.x to 2.x. No reason to delay and you’re actually limiting yourself by not doing so at this time.

---

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 15, 2019, 6:29pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/6 "2019-01-15T18:29:24Z")

</div>

I tried string split using a code block  
“;”;  
but it didnt do anything to the output

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:30pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/7 "2019-01-15T18:30:27Z")

</div>

You can’t use “;”; in a code block as ; is a special character. Use a string node or escape it with a .

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:31pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/8 "2019-01-15T18:31:08Z")

</div>

Well now it seems that \ is an escape character on the forums too… use “\;”;

---

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 15, 2019, 6:32pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/9 "2019-01-15T18:32:03Z")

</div>

\ perfect I will use the escape character

---

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 15, 2019, 6:33pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/10 "2019-01-15T18:33:49Z")

</div>

Thanks for your help

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 15, 2019, 6:36pm UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/11 "2019-01-15T18:36:00Z")

</div>

Testing it now - best to just use a string node as the ; is a PITA to use in design script - forces a new line because “reasons,” so you have to go into the codeblock after you type it and edit it which is way harder than it seems due to that bit of auto-formatting.

Ok lunch is over - back to the real work.

---

<div class="post-metadata">

**Author:** ![BIMadmin](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@BIMadmin](https://forum.dynamobim.com/u/BIMadmin)\
**Post date:** [January 17, 2019, 10:25am UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/12 "2019-01-17T10:25:49Z")

</div>

Sorted now,  
The output from springs.docdeleteelements  
Needed to be separated by ;  
Using the string node and not a codeblock

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/e/7e6e73c6095e76cdbf5cc7231b2060a91974d642.jpeg)  
Here is the def if you want to use it  
Credits to JacobSmall  
[Move views between two sheets\_v1.dyn](https://forum.dynamobim.com/uploads/short-url/x6eeE576lw5wL6c4eLaMOyIn7ML.dyn) (40.9 KB)

---

<div class="post-metadata">

**Author:** ![Zia](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@Zia](https://forum.dynamobim.com/u/Zia)\
**Post date:** [September 17, 2019, 3:47am UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/13 "2019-09-17T03:47:31Z")

</div>

Hi BIMadmin,

Thanks for sharing this dyn file. It will be quite helpful to organize views in sheets. I am quite new to Dynamo and got an error issue when I opened the file. Please see the screenshot. Is there a way to solve this problem?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/0/60693c21b21eaa2ba0cd34219d3c30de5f7b65eb.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 17, 2019, 5:18am UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/14 "2019-09-17T05:18:45Z")

</div>

You need to install the Springs package.

Search for `Springs` in the package manager per the directions here: [Package Introduction | The Dynamo Primer](https://primer.dynamobim.org/11_Packages/11-1_Introduction.html)

---

<div class="post-metadata">

**Author:** ![Zia](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@Zia](https://forum.dynamobim.com/u/Zia)\
**Post date:** [September 20, 2019, 3:58am UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/15 "2019-09-20T03:58:46Z")

</div>

Thank you very much Jacob. The problem was solved. When I run it, it showed warns below.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/c/1cfcb9d033341ad7c5b057917ce12f51a08e5eb2.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 20, 2019, 4:05am UTC](https://forum.dynamobim.com/t/move-views-between-sheets-using-a-dictionary/30715/16 "2019-09-20T04:05:07Z")

</div>

You need to wire in the values input.
