Working graph with 2 errors

I’ve got a simple graph that renames views. It works, but returns 2 errors. I have spent some time looking up the errors but they’re pretty generic and the solutions seem a bit expansive for my little graph.
What could be going wrong if the graph works? I have tried it on many Revit files and it renames the views just fine… but returns these errors.

renames views - works with errors.dyn (23.9 KB)

Hello @emodderman - You’re pretty close! The salient bits you need to change are due to the way Revit works, see attached image. Basically you cannot rename nothings (Nulls) and it’s also probably best View templates also.

I’ve also uploaded a working graph for you to use :slight_smile:

renames views - works with errors_SA.dyn (26.9 KB)

Thank you!!

ok, so basically, the errors were because the nodes were looking for the View Name parameter in the View Templates and wasn’t finding it and returning the errors, but was finding it in the Views, which is why seemed to work. Yes?

There never seems to be a simple graph in dynamo.

You are most welcome @emodderman :slight_smile:

Short answer is yes, you are correct. What Dynamo is doing is pulling all of the category of “View” elements from the Revit Model (or Document) - and encapsulated inside of this are multiple types; Real views (Plans, sections, elevations etc.), View Templates and one null item.

In Dynamo you will parallel how the Revit API works, so need to think a little holistically about how to create graphs that work like this.

Most Dynamo graphs follow roughly this layout:

  • Get all the things
  • Get the relevant things from all of the things
  • Do something to the relevant things
  • Make changes back in Revit

Great! I guess that “Get the relevant things from all of the things” step is where I get mixed up every time. I should have paid more attention to the contents of the list!

1 Like

When learning Dynamo (Or building any graph in general!) I always keep one Watch node in canvas and use it to check every output of a node, just to make sure the data that comes through is expected :slight_smile: