Duplicate as Dependent and Name Views


#1

I am trying to take an existing view in my project and duplicate it as a dependent using the quantity of scope boxes as the number of dependents. That portion of it is working great; I end up with the correct number of dependents on the correct parent view.

Duplicate as Dependent Works

My issue comes from trying to add the name to the views. When I connect the View.DuplicateAsDependent node into the element portion of Element.SetParameterByName, it doesn’t name the new views. Instead of naming the dependent views based off the list.combine node, it names the original parent view and leaves the dependents un-changed.

Naming Dependents Does Not

I have tried adding an End node, creating a list out of the View.DuplicateAsDependent node, and added a chop to that list. Also, when I add the Element.SetParameterByName value for Scope Box, this too effects only the parent view and not the dependents. Here is my current script as well as a download link below.

Dynamo Script
Dropbox Download of File


#2

So, having not gave up on my idea I have kept looking online. I have noticed all the other people who tried to do this started with an excel file and then came into Dynamo to create views based off that spreadsheet. I am trying to avoid that if possible. Any suggestions?


#3

@Tgoodale I tested your .dyn file and it worked for me on a sample file I made with three scope boxes and one level.

On the file I opened and in your image attached above, it doesn’t seem you have connected your new dependent views to the Element.SetParameterByName nodes so your dependent views aren’t being changed; I am unsure how the parent view is getting changed from what I am looking at above or from the .dyn file you uploaded :thinking:

Here is your file back to try, but all I did was connect the View.DuplicateAsDependent node output to the Element.SetParameterByName nodes inputs:

If it still doesn’t work, a stripped down version of your .rvt file or a similar sample might be needed to help you get it sorted


#4

Thanks for the response. Knowing that it worked for you I had a coworker run it on their machine; it worked flawlessly. I have tried recreating it on my machine and it will not work. The anomaly is that when they run it, and my assumption is when you run it as well, the new views have different Element ID Numbers. When I run it, they all retain the same ID Number as the original view that I wish to duplicate. I don’t know what is causing that though.