Move views between sheets using a dictionary

Hello all,
Following my previous post

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


41_Move views between two sheets_v1.dyn (39.4 KB)

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.

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 ,

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.

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.

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

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

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

\ perfect I will use the escape character

Thanks for your help

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.

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


Here is the def if you want to use it
Credits to JacobSmall
Move views between two sheets_v1.dyn (40.9 KB)

1 Like

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?

You need to install the Springs package.

Search for Springs in the package manager per the directions here: https://primer.dynamobim.org/11_Packages/11-1_Introduction.html

Thank you very much Jacob. The problem was solved. When I run it, it showed warns below.
image

You need to wire in the values input.