I assume I’m not understanding how an IF node works, although it seems pretty straight-forward.
I am trying to halt the script if a boolean is set to false. The problem is, when set to true, it’s not passing along the data I’d expect.
Without the if in the script, a list is passed to FamilyType.Create and it works fine. When the boolean is true, I’d think that same list would be passed on, but it’s not. Do I have to have something on the false end of the if statement for it to work? I don’t want to give it anything if the boolean is set to false.
Is there a better way to just stop everything like this?
you could also use a code block, this way you dont need an empty list as false input. I could write one for you if that helps.
(Every node that you place needs to have all the inputs in the front connected, otherwise it will be light grey and your only output will be: “Function”.)
This is actually still not working. If I have the if block in place, the new types are not created whether the bool is set to true or not. If I bypass the if block, it works fine. I no longer get errors on the FamilyType.Create when using the List.Empty, but it doesn’t seem to do anything.
What error and data structure are you getting out of the other nodes around. And check if the families have already been created because that will give you a error
Also while i remember change the “If” node to a “ScopeIf” node, and give that a try.
For whatever reason, when using @Daan’s code, the script runs whether the bool is set to true or not.
@Brendan_Cassidy
I have the RFA file open as I’m testing. I can see when it does or doesn’t create the types. The only error I’m getting right now is in another if scenario where I’m building the type names. (Another example of where I want an if to either run THIS node or THAT node and not just pass on the output of one of those nodes. I don’t want one node to run at all if a condition isn’t true. Seems hard to do with if statements. - But I don’t want to splinter this thread with that conundrum).
I’m pretty well-versed in php and jscript, so I know my way around conditional logic in other languages. I have no idea why this thing is running regardless.
Tried the ScopeIf and now I think it’s crashed. Says “Run started…” and won’t finish.
But i think the problem lies not with the if statements used, they shouldnt alter the information which was input. I think your orchid package is just doing something weird.
HA! I had just screwed up when using your block, @Daan. I was hooking the value of B to the next node instead of C.
That bit works now. Any suggestions on a better way to handle the " Create Type Title from Number and Note" portion of the script?
I want to pass the string on if it is less than 30 characters, if not, I want to do a substring limited to 30 characters. I get an error on the substring node because I am running it even if I’m not using its output. When the string is shorter than 30 it throws a warning.