Retrieve Active Viewname

I’ve tested some nodes to get the Active Viewname.
Can anybody explain to me why it doesn’t work with Dynamo nodes in Revit 2022.
It does work with a node from Clockwork. :slight_smile:
(I know it is strange because it uses the same Dynamo nodes)

Can’t say I have seen this; if you close the graph and reopen it what do you get?

Hmm… when I reopen the graph and run it, both works correct.
But when i switch to an other View both give the wrong View.
Is this a bug or do i something wrong?

You need a trigger to cause the nodes to refresh.

Both nodes have and input, but you have to make a change to the data going into the input for it to know it needs to re-execute.

I recommend using the out of the box node, and putting a code block between the document node and the ActiveView node consisting of update? doc: doc;. Then wire the document node into the doc input and a boolean node into the update input. Anytime you want to refresh, just toggle the boolean.

Alternatively you can leave it as is and only execute the graph via Dynamo Player, as all nodes execute on each run.

1 Like

If it helps, I have a node in Crumple built to deal with this refresh challenge called ‘CurrentView’. It does the same thing but has a refreshable input which you can toggle a boolean into (or anything really - it just has to change).

1 Like

yeah or try datashapes “force run” from extension bar

1 Like