New to here and dynamo

Ok so I am totally new to this forum, but I have been messing around with dynamo for a few months. I still have no idea on what I am doing with it.

So I work on several projects that are pretty large. (example: 4 quadrants with each quadrant having 4 segments.) I have to create dependent views for each quadrant and each segment. I have a total of 5 floors for Mech, Plumb, Elec, Telecom, Security and Audio/Visual.

Now knowing that you can right click on the view and duplicate as a dependent for each view, and create each dependent view that way. But being that I am looking at roughly 100 dependent views for each discipline, I might go grey before I finish.
So after researching online and trying to get things done myself, I have hit a brick wall. When I run this script it is creating a dependent view for every single view that is in the project and doing this under each view. So I am getting over 100 dependent views for each and every view. :astonished::astonished: I wanted to see if there is an easy way to be able to have this script run and come back and select all the views that are wanted to have dependent views created along with the number of views you want created for each.

Can someone give me a some help with this? I have a feeling that the cause of this is due to the node above not being correct. But then again I could be totally off track here. And I hope that this is making sense.


Now I would need to do this for each level, and each discipline.

For the node - View.DuplicateAsDependent the one that I am able to find already loaded shows:

But researching online I see it differently:

This should be fairly easy in terms of the logic you’ll have to follow. Lucky for you, your scope boxes are already named pretty well (although you could make some minor changes to help you out even more.)

You’re going to want to filter your scope boxes for the QUADRANT and SEGMENT boxes separately. If you can, it would help if you could somehow name the segment boxes with the quadrant they belong to. The general idea is that you group each segment by the quadrant it belongs to and create your duplicate views based on these grouped scope boxes. This of course gets repeated for each level and each discipline.

well i have to say that i am glad that you are the one that responded to this post first. being that we used to work together a few months back i know that you are giving me good info. (i was out of the phoenix office and always had issues with SP. Proto Type) haha

i think that i am understanding you correctly. i ran this and it looks like it was working, it created one dependent view under each one. what would i need to add in order to get this to come back and ask me to input the amount of views that i need to create? i am wondering if the string should be something where it would be able to ask for input (so QUADRANTS OR SEGMENTS) before it returns the results. also i am not sure that i am understanding the errors. let me know if i am on the right track?

Oh awesome! I honestly read your situation and thought “that sounds a lot like how we setup drawings.” :laughing:

You would need to use StringContains to see if the scope box name contains QUADRANT or SEGMENT. I assume each discipline will have a view for each quadrant (on each level) and each of those views will have dependent segment views. Is that correct? If so, you would have to group your segments by the quadrant they’re in. Then you would count the number of quadrants and create that many views for each discipline and each level. Once you have those views setup, you would duplicate each quadrant view by the number of segment views it contains.

I would start out by getting your scope boxes filtered and grouped together.

So the one nice thing, is that each discipline has its own model. so i wouldnt have to filter out between disciplines.

OK i guess where i am lost at right now is with the StringContains node, would i then attach a String node to the str? or use a code block? i am not even able to get the scope boxes to show on any of the lists so that i can group them.

Your filter would come after your list of elements and element names.

Categories (Scope Boxes) > All Elements of Category > Element.Name > StringContains.

Ok, so I ran around like a chicken with my head cut off. i tried a few different things and it seems like i might have finally figured this out. i still have questions. like for example it is creating dependent views for even 3D views. what would i need to add to ensure that the script is only going to create for lets say “floor plans” or “ceiling plans” rather than only relying on the scope box.

as you know there could be scope boxes added for no reason what so ever.

so i am trying to figure out what the List.CartesianProduct is returning 5,324? is that how many views that are being created?

I honestly have no idea what you’re trying to do with that node. Don’t duplicate anything until you have your scope boxes grouped the way you want. There’s no need for brackets with your strings - as you can see it’s not finding any matches. The list of true/false from StringContains will be used with FilterByBoolMask to filter the names.

Ok so with all the information I started with I got from a post on another site. It didn’t have the file but just a picture. So I re-created it and that is what I was starting with. I have been watching YouTube like crazy on several things. So tomorrow I am going to start from scratch! I found a video one YouTube that was walking through step by step on how to build this type of thing.

I will send a snapshot of what I come up with to get your thoughts on it.

Thanks again for all your help! Tell RP I said hi!

ok, so after some much needed research and reading to understand more on what the nodes are doing. i have been able to get things down pretty darn close! i have it working for me as far as creating the dependent views. the issue that i am seeing is that the dependent views are being created with the same name, and then adding at the end of it “quadrant 1” being that is what the scope box is named.

the code block where it is renaming things [v_name+ " - "s_name;] i think is where i need to make the changes to elminate that issue. however i dont know how to get that to work. lol

let me know what you think when you have a free moment.


the second image showing the red box is what i am wanting to not have in there or to be able to remove that.

I can’t read your screenshot. Zoom in until the nodes are legible and use Export Workspace As Image (camera icon) in the top right corner.

You should have two lists of scope boxes. One for Quadrants and one for Segments (grouped by quadrant). Then you can concatenate them together to get the appropriate name.

yeah i am not seeing that in there.

let me know if you are able to see the screen shot.

Can you turn on all your node previews? Otherwise we can’t really tell what’s going on.

Here ya go. i also tried to spread things out a little bit to make it easier to read. i am also going to send you over the file in case you want to open it up and take a look. not sure if that will be easier.

I would take a step back and work on it piece by piece instead of all at once. I think your view selection is working correctly, so lets look at your scope boxes.

  1. If you can name your scope boxes so that you know which segments are within which quadrants it will make things a lot easier. (eg. QUADRANT 1 and QUADRANT 1 - SEGMENT A). This will allow you to get all the quadrant scope boxes and then use those names as a filter for the segment boxes.

  2. Don’t duplicate your views until you know you have the right list structure and the right names. It would probably be best to duplicate your views in two separate steps. First, duplicate all the views for each quadrant. Then you can use the new quadrant views to create dependent duplicates for each segment in that quadrant.

  3. Make sure your naming convention for everything involved (views and both sets of scope boxes) are appropriate for the combining you’ll be doing throughout the process. It looks like your views already have the quadrant name in them which is why it’s showing up twice when you create the quadrant views. For the segment views, rather than adding the scope box name, you can replace the quad name with the segment name (since the segment scope box will now include the quad name).

ok so i was taking a look at the two list that you showed above. (the watch list nodes)

what do you have those connected to?

so for that, i tried several things to see what would work and it wasnt happening. i did get one full list that will group everything together inside that one list. i just cant figure out how to create a list for each scope box type. i even tried to use viewfilter.createfilter and yeah clearly that wasnt working being that these arent a view. lol

That’s what you’re trying to figure out. I created the lists that way to show you how they need to look in the end.

If you name your segment scope boxes with the quadrant you can filter for the quadrant boxes and then use those as a filter for the segment boxes.