Removing duplicate views and applying view templates

Hello, new to dynamo and I created a script that creates views from levels and then creates sheets and places those views on the sheet. Right now I am having trouble removing the ‘create view’ sections; I just want to create sheets corresponding to the views already made in Revit and add those views to those sheets. I’m sure it is easy but I haven’t got it to work yet. Also, how should I go about applying view templates to the views, and is there a more efficient way to do this? Seems cumbersome as it is now.

What have you tried?

Rather than passing the created views to the sheet creation node, pass the existing views from the project. You’ll probably want to check to make sure none of the views are already on sheets, but that’s an easy check.

View Templates are just like other parameters. You can set them with the SetParameterValueByName node. Just be sure to provide the actual view template element.

This is what I have tried so far. What is wrong with how I am passing the existing views? I am not sure how to implement the setparametervaluebyname node in here, either. Still working on it, though.

Make sure you’re showing the node preview bubbles and giving us any warnings you’re running into. Otherwise we have no idea what your graph is actually doing.

Your FilterByBoolMask is failing. The mask input needs to be a list of booleans to filter the input list by. Also, you don’t need to “convert” your views to a list before filtering, it’s already a list.

Second, you’re not using the right node for setting the View Template. You have a node for a family document. You need the basic Element.SetParameterByName node.

It runs without errors now (haven’t implemented the template part yet) but it doesn’t create all the sheets and it skips some?

Here is the Revit part

You’re still not showing most of the node previews. We can’t even see everything you’re passing into the sheet creation node.

You’re filtering the Section views now but you’re not filtering the views that have already been placed on sheets so you may be running into issues there.

Apologies, 5 days into dynamo, I didn’t know what you meant by node previews. Is this the preferred format for posting here?

My filter was the issue it seems but is there a way to filter for more than one string? I know in hard coding you can use OR statements or something similar but is there a node or something similar to that? I am unfamiliar with python syntax. I need to filter out architectural and the non-numbered views.

Regarding applying the view template: Would I go from the list.filterbyboolmask node straight to the element.setparameterbyname node? I am confused as to what passes into that node because the view templates are classified as a view category.

Thanks for the patience

No problem. If you’re ever not sure what someone is referring to, just ask. I’d suggest you work your way through the Dynamo Primer to get an introduction to the basics before moving onto a larger graph like this.

Having the node preview bubbles pinned like this makes it so we can actually see what data you’re working with. Always include it in your screenshots. Also, make sure you’re zoomed in enough that the node titles are visible. In your screenshot above, the nodes are illegible so we don’t know what they are or what your graph is doing.

Yes. There are many options:

  • Multiple standalone filters in series
  • List levels for multiple filter conditions (if the filter is the same condition but multiple values)
  • Nested conditions in a code block

You can check the forum for examples of each of these options.

Once you have your final list of filtered views you would pass that directly onto the SetParameter node. Some parameter values are elements, View Template is one of them. You need to provide the View Template element to change the view template of a given view.