Model Elements Collected Do Not Update on Automatic

Hi,

When I was developing a definition, the automatic setting would filter in walls as I built them, and delete them when I deleted them. For some reason my definition when I opened it today will not actually run automatically. I delete elements in my model, and it is still calculating them.

How do I reestablish that connection?

Thanks,

Kevin

I am surprised this hasn’t gotten any responses. It seems rather elementary…

To verify for all of you, the automatic setting IS turned on! :grinning:

Any thoughts anyone?

Thanks Erfajo. Maybe this will help clarify.

I have an element in my model:

Then I delete that element, but it does not recalculate:

Thoughts?

This isn’t just to that element. It is any element I model. All of a sudden it just won’t calculate. Even if I switch it to manual and hit run. Nothing updates.

Here is the download link for the files:

It contains the .rvt and .dyn file. I appreciate any help you can offer.

Thanks!

Kevin

I would say that is because the view is an input, and as it doesn’t change in between runs Dynamo doesn’t re-run that selection node.

Try other selection options, by category for example:

1 Like

I don’t understand what you mean by that. The element in the view changes, so the view doesn’t change?

I can’t do this by category because I need to select all model elements, regardless of category and then filter by my own project parameter. Apparently by view is the best way to do it.

I also don’t quite understand how All Elements of Category would run any differently than Elements in View. If an element is deleted, its deleted in both of those nodes (or I would expect anyway). Am I missing something?

Try wiring a “run me” node in after the view node which you can toggle with a true/false node to force a recalculation. Feeding false through your script shouldn’t hurt things, and refeeding the correct value should update things accordingly.

Hmmm I can try that. But I don’t really understand how that node works. How do I define the “Thing To Do” ?

It doesn’t seem to exist in the Primer and the tool tips when you hover over the input in Dynamo are utterly useless :frowning: #Bettertooltipsfornon-codingusersplease!

Erfajo,

I am trying to use that thread (http://dynamobim.org/forums/topic/get-all-objects-by-parameter/ ) you posted to me but I keep crashing it when I try to connect the python script to element.category. I am not a programmer so I am trying my best not to do this with python nodes. I won’t be able to effectively troubleshoot them.

Then I went to yours and I am trying to develop that node with your script but I dont know how you got Out[0] and Out[1]. Mine only has one out after pasting your definition in.

Is there a way to collect a list or filter by a pre-determined list of categories without python?

@erfajo

I finally got your python script to work (I think) and it successfully filtered out by category the items I wanted. However, the same problem persists. I try to model more elements or delete them and
the list does not update!!

It is exactly the same problem I was having with the original method. Any ideas for how to get this thing running again?


Bad news first: Dynamo won’t do what you’re trying to do by design. You’re asking the program to constantly run a calculation which could be a VERY large data set - imagine running your script on a model with over 50,000,000,000 elements - just selecting that many items would slow you down. Now imagine trying to do that non-stop, every instance of every moment forever. How long do you think your system could keep up? BAD JUJU would result right?

In order to prevent this dynamo doesn’t clear out the cache every time, and pushes the results of a node along acordingly. That means that collection of 50,000,000,000 elements only needs to be done once. Why recalculate all that if nothing has changed. I bold that for a reason. Try copying the view node, pasting a new one, and rewiring the new one in where the old one was. Did your results change? By changing the input you forced the script to rerun. That said, it can be problematic to ask someone to copy/paste, wire and unwire stuff correctly…

Now the good news: you can make dynamo redo something by using the Tool.RunMe node (or a similar code block) in between your “Views” node and your “ElementsInView(s)” node.

Every time you want to rerun the graph change the value to false, let it run, and change it back to true. No this isn’t automatic but it’s the best you’ll get with basic out of the box stuff.

Technically, UI nodes can subscribe to Revit events. One such example is the “All Elements of Category”:

So whenever you don’t have an active command in Revit and you’ve made changes to the document, the node will force-rerun itself. This was actually an issue a while back because it was causing infinite loops. You can (ab)use this feature as your automatic refresh like so:

Here’s quick demo. Look at the total count:

I have to agree that using this on a real project would be detrimentally slow though.

3 Likes

I think what you ask for is something similar to picture below. Adding a node that can run periodically at the beginning will make your graph run every certain specified amount of milliseconds, and using for example the “Spring.Collector.ElementsInView” node, your elements will be updated almost automatically.


With this said, I personally wouldn’t use it in automatic/periodic mode, as it will slow down the workflow and usability of Revit and Dynamo quite a lot in large projects and dynamo graphs.

Hope it helps.

I think Jacob’s response is the solution to use here. If you can’t run it auto, a simple toggle to get it to run is ideal.

The “manual” setting run SHOULD work for this, but it doesn’t.

@erfajo I wound up using a combo of one of the python scripts you referred me to, and the tool.runme to get close.

So do I need to use the OST Categories? I have been going out of my mind trying to find the dang Wall Sweeps OST category.

Although the topic has been marked as solved, just as an extra to your selected solution you can use @jacob.small last example with a Code Block but changing it to something like: (rerun) ? ThingToDo : ThingToDo;, so you will save a few clicks as it always will get evaluated even if set to false :slight_smile: