How to prevent All Elements Of Category from rerunning during scripting

Hi all, I am having the following issue. Consider the script underneath. It collects all elements of a category, and then checks for a list of values if those values are present in the collected elements Comments parameter. For values that are not present, it creates a new element of the same category and writes that value to the same parameter. Now the issue is that while I am scripting and the graph reruns, the All Elements Of Category node automatically reruns, which leads to a situation where all values are present, and the FamilyInstance.ByPoint node stops returning elements. This makes it impossible to write/debug any more code that is depending on the FamilyInstance.ByPoint output. The only thing I can do is delete all elements from the model, and rerun the script, but I have to do this every single time! So my question is, is there any way of preventing the All Elements Of Category from rerunning while I am scripting? Help much appreciated. Test script is attached. Thanks in advance
@solamour any idea?

test_recollection.dyn (27.0 KB)

OK, I though of this workaround. But still interested in other ideas!

A few options:

  1. Use a Data.Remember node to ‘pack’ the list of items into the graph, and detach the all elements of category node prior to the second execution.
  2. Build a custom node of the selection nodes that has a toggle to control in-session re-execution.
  3. Do the collection with a Python node with a toggle to re-execute.
  4. Use another selection method (ie: element IDs) for debugging.

My order of preference would be 4, 2, 3 and 1, depending on the project complexity.


Thank you @jacob.small !

1 Like

I observed that if you get the elements with python script node usually it doesn’t rerun again unless I add a toogle button to it or modify the node again