Hi all,
Is there any way to reverse the If statement to where it goes down different node trees based on if the test was true or false? I am making a drop-down selection and if the user selects walls I want it to go down one node tree and if they select roof want it to follow a different set of nodes. has anyone figured out a good way to do this? Normally with the If node you would have to make these 2 separate node groups before for true/False but hopefully someone knows how to do this for after?
Probably the only way to do it without doing it in Python would be to use an If node to check on one path if Wall was chosen, send it through, otherwise send nothing. Then on the Roof path do the opposite, that way one branch executes nothing and the other executes with valid data.
Thereās scopeIf as well which might work to some degree, but Iāve rarely had much luck with reversed If statements that use more than 1 or 2 nodes using the OOTB options.
If you are prompting for a user selection, i suggest using the Data-Shapes UI nodes. This way you will only deal with one selection
I would use a Python-Node like Gavin told you or a Code-Block with an imperative language block which only runs if neccessary. Keep in mind that you have to do this for all following nodes of the unused path if you want that your code runs without the message ārun completed with errorsā. Itās annoying but it works.
Thanks for the Help Everyone!
I solved it by using Gavinās Method of with the Additional If Node + False attached to it.
I guess I will live with the āCompleted with warningā message every time for the sake of minimizing the python needed.
I decided to try the imperative statement but it isnāt running correctly.
Do you have any guidance on making this imperative work? If a = false I donāt want it to continue executing the rest of the nodes but if the input is not false I want it to continue running
Donāt use āreturn = aā and use āreturn aā instead. Have a read here:
As far as I can see you would reveive the error message ārun completed with errorsā if a=b, because then the code block would return null to the next node.

