Boolean Input

Good day!
I want to copy geometry from active view to selected ones. I have already gained a worked script for copying. But smth goes wrong when I work with node Document.ActiveView.
I connect 2 booleans as input values to refrash my data. It works but unstable. I need to switch False to True or True to False somehow to get a desirable result.
How can I use booleans to refresh my input and get in the same time result after compiling?
Maybe I don’t eventually understand the logic of Booleans’s work.
Screenshot is attached.

What is the error you are getting?

Seems to be weird:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. Traceback (most recent call last): File “”, line 30, in ValueError: Index out of range. The index must be a positive number and must not exceed the size of the collection. Parameter name: index

Well not that weird. It states that in 30 you have an index out of range error.

Index out of range is when you try to get an item out of a list, but the index you are giving is not in that list.

From experience I know that with this error stating it is line 30, you should look a line back, so 29.

There you try to get the first item out of a cropshape, but the cropshape (loopsSource) is probably faulty.

And what is strange is when I click again False to True, it works.
Look at image

The problem lays probably in the difference View and Floorplan

In the first picture you posted you has another view then the second.

The first view probably doesn’t have CropShape, which gives you an error?

But it should be the same view because I have one active view at the moment.
As I understand document.ActiveView provides with the current opened view, don’t I?

Yes the name states that it will return the active view you have open in Revit at the time of running the graph. If you then switch to another view, Dynamo will not notice this if you press run again, this is why the node has a “Refresh” input. switching this from true to false or otherwise will tell the node to look at Revit again and get the Active node.

Setting the Refresh to True does NOT mean Dynamo will get the new active view automatically everytime you switch a view and press Run

Okay, it is clear, thank you. Can I somehow figure out it to launch code from dynamo player? Or I need to find the other way for my task?

Well, the good thing about the dynamo player, everytime you run a script, Dynamo re-runs everything. This way you will always get the active view.

Unfortunately, my program doesn’t work through the dynamo player

Could you share the graph?

1.dyn (14.6 KB)
This one