Document.ActiveView

 

 

 

 

 

 

So I created a little script that isolates some elements in a given view. Works great the first time I run it. Although if I switch views it doesn’t work, and from what I can tell it’s because the Document.ActiveView is getting the current view. It still shows the view from the first I ran the script. If I close and re-open dynamo then it works.

 

springnodes allows a refresh

2016-04-01 10_30_29-Dynamo

1 Like

Ok. I will check that out, but shouldn’t it be doing a refresh automatically?

I would think so, but sometimes Dynamo is weird.

Huh even the “spring nodes” node is plagued by the same thing.

Did you toggle the boolean after changing views?

Maybe I am miss interpreting what the Boolean does. I assume true meant with will always refresh, and false means it won’t refresh. Is that not the case?

Sound like what you asked is that the Boolean is acting more like a button in grasshopper??

From my understanding many of the nodes that read revit only run once, unless their input changes.

The active view node only runs once because Dynamo is being efficient with data consumption. You do not want it run every node every time (some nodes can take a very long time to run). I would like a run from start button that runs every node from the start and the current run button that only runs changed nodes.

The boolean does not mean run or not run in this particular case. As I stated above the current run will only run changed nodes and all nodes down stream. By changing the boolean from true to false or false to true you are changing the data making dynamo rerun the node and all down stream of it.

Thanks that all makes sense expect for the fact that the active view inside Revit changed so shouldn’t that trigger a change in dynamo. If I reference a column into dynamo and then change its type dynamo automatically updates. Seem like the same should be true for active view.

Well, there is a lot of things in Revit that happend that “trigger” changes to Revit Document. The idea is to filter these out and only allow certain types of changes to force Dynamo to refresh. I don’t exactly want Dynamo to refresh and start re-running my definition every time someone zooms in or out in the view. Changing the active view is not that big of a change to model database, so it must have been classified as something that does’t trigger dynamo refresh. This is expected behavior.

Yeah but do those types of “triggers” have specific nodes that dynamo is looking for? I still think it’ strange to create a node that looks for a certain state in Revit (active view), but then when that state changes dynamo doesn’t see it. Besides the “All Elements in Active View” node updates when you switch views, so why wouldn’t the generic “Get Active View” do the same?

1 Like

Thought I’d share this, as this was one of the threads reviewed when trying to come up with something that would refresh active views.

This script uses Archi-Lab, SpringNodes, SteamNodes and Clockwork nodes to highlight and clear untagged elements (thank you!). I wanted to set up a workflow that a non-Dynamo user could walk into and start using. When the "refresh active view’ boolean is set to true, the nodes downstream are fed null values, interrupting the script, but refreshing the view. When set to false, the script is run with the new view selected.

I’m sure there’s a much more advanced approach that i’ll learn someday, but I like the way this turned out.

Just ran into the same issue of the Active View not refreshing. Found that when the script runs from Dynamo Player the Active View is refreshed automatically.
Anyway, I’ve developed a script that analyses the elements in view and hides the ones that have their Classification (two Type Parameter) filled (link).

Can you share how you highlight the tagged elements?

Thanks,