Undo running script when IF is false

Hi,

Is there a node that Undo running the script when the IF value is false?
The script is duplicating views and creating sheets so it takes a lot of time.

When the test value is false I want him to do “nothing” and undo run, when the value is true I want him to run.

I don’t know if there is a node that could do that. However you can use the 'If node to check a condition is true/false before proceeding?

Thanks for youre reply, i’ve tryed but thats hard.
I’am duplicating my views, after that I’m creating my sheets and after that I search my “Sheet Width”
When the length between my first viewport and last viewport is bigger than my Sheet Width the script had to undo everything and give a message. When it is smaller he has to do the action.

Sheets genereren.dyn (260.2 KB)

Sounds like a math calculation? Like below:

Not sure where you’d position a checking procedure in your process. However you could add within your message the the user has to press undo? Alternatively as you are duplicating views at the start you could use their information/values for a test before creating the new views and sheets?

Yes it’s like that.
I’ve tried to do it but in my true/false value is at the end of the script.

So the value come when the sheets and views are finish.

I am not sure what you are trying to do exactly, but the scopeIf node - does not behave like other nodes, the mismatched branch will not be executed (unlike regular if)

Hi Michael,

I’ve tried, but when I use the ScopeIF he give me the next warning:

Warning: A cyclic dependency exists between two variables
A cyclic dependency exists between two variables

The test value came at the end of the script.
When my Sheet Width is smaller than the (curve) line from the first to the last viewport he have to exit the task.

scopeIf requires that the two input branches are completely separate. The docs are unfortunately not clear on this.

Is it ultimately possible to use a true / false value and add this at the front of the script? the true / false is visible at the end of the script.