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.
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.
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 and Out. 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?
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.
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:
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.
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