True/False Gate or passthrough?

I am trying to find a True/False gate (that might not be the right word) for my script. I am batch-style creating views and I an experimenting with a different method.

I am looking for a node that can allow/block the creating of new views based on Boolean input. I have not found a node from the packages I have downloaded yet. I am creating views based on UI, compliments of the Data-Shapes package, to create views based on sub-discipline with attributed templates. But the main issue I am facing is getting my script to function the way I Need…any help is appreciated.

Test?
IfTrue:
IfFalse;

Try that in a code block.

Should clarify: the if false can be a null value or something which will error out the rest of your graph downstream.

1 Like

Thanks @jacob.small I gave the If/Then code block a try. But I am not sure how to integrate that into my script in a format that it will accept. I was curious if any nodes for creating elements had the toggle like they do for deleting them (see image).

If this option is available for element/view creating this will open a LOT of possibilities.

Instead of the pass through, the test goes first, then the if true is the thing offscreen that would only want to continue if it was true, and the if false can be replaced by a null.

If the test is true, pass the result. If the pass is false never mind perform functions on nothing.

Post a more complete graph with your attempt and I can mark it up for you.

The top row is a True Test and the bottom row is a False test.

What kind of output do you want from it?
It might not be necessary to do it like this. The IF statement in Dynamo is pretty weird, but it isn’t useless.
Otherwise, I’d suggest doing it like:


So when you give false:

When it comes to a passthrough though even a null wil be an appropriate “activator”.

@jacob.small @PauLtus


This is a more complete image of what is going on. I am using Data-Shapes to toggle a selection of Sub-disciplines for views to create.

After all the data-sorting is done, the inputs are separated into separate sub-disciplines for view creation. I am trying to have a toggle, similar to when you delete something (see previous post for image). If this is possible, or already exists that would be awesome.

In an ideal script, the null would not be an appropriate ‘activator’ and would not let it create the views. I don’t know if this is possible :confused:

This is what you’re asking for, but it sounds like you are actually after something else entirely…

Can you post your .dyn?

1 Like

I am not certain what the View.ApplyViewTemplate node does, but would it still function if you’d give it another “View Template Name” input?

Hi there. I guess you are looking for something which allows you to set options for what parts of the script will run, and those which will not. (If you can speak grasshopper, the “dispatch” component?)

Maybe this?

The Inputs for “a” in the code block and List.Take Items are the same list.

2 Likes

try the scope if node - but make each branch totally independent. A regular if node will execute both branches.

1 Like

6 Likes

I wish i had known that about 6 months ago.

nice…

This is what I was looking for as well, trying to create element framing in Revit with a condition. And gives no warning message for delivering and empty list. Thanks!

Or you create a simple python script if you want to pass more information with a single bool.

bool = IN[0]
list = IN[1]

if bool == True:
	OUT = []
else:
	OUT = list