Why is it that an input reads null inside an Imperative Function?
For example:
This would work, with input being driven by any integer manually or by slider.
input;
output = [Imperative]
{
if (input == 0)
{
output = “ZERO”;
}
return output;
}
Successfully returns “ZERO”
However, once I turn it into a function:
def GOGO(input) // I’ve tired input:var, input:var[], input:int, intput:int[], input, etc…
Additionally, everytime I restart my dynamo I get an error for that code block saying Variable isn’t defined yet. Seems like a bug. Using the latest version of Dynamo 2.01.5
I tried on another machine and it seems to be working now. Very strange why does a code block behave differently on another machine? Anyways looking at your code, couldn’t it be simpler to do this? Why do you have different return outputs and two ending semicolons?
I have found that sometimes I need to restart Dynamo for my imperative blocks to execute correctly. It seems that after being executed a few times they get tired and need a restart