Calling parameter from inside Imperative code block

Is there a way to call a parameter from inside the Imperative code block?

When I have an x parameter outside the Imperative(like below) I can get the Input entry in the Code Block Node but the imperative does not recognize x.

If I put the x parameter inside the Imperative Code Block I can’t get the Input entry. Thanks…

x;
geom = [<span style=“color: #8c5eaa;”>Imperative</span>]
{
<span style=“color: #8c5eaa;”>if</span>(x><span style=“color: #2585e5;”>3</span>)
{
<span style=“color: #8c5eaa;”>return</span> = <span style=“color: #8c5eaa;”>true</span>;
}
<span style=“color: #8c5eaa;”>else</span>
{
<span style=“color: #8c5eaa;”>return</span> = <span style=“color: #8c5eaa;”>false</span>;
}
}

x;
geom = [Imperative]
{
if(x>3)
{
return = true;
}
else
{
return = false;
}
}

//Define a funcion

def boo(x)

{

return=[Imperative]

{

if(x>3)

{

return=true;

}

else

{return=false;

}

}

}

 

//Call the function

boo(3);

Dyn-20141231-1

Thank you

1 Like