Calling parameter from inside Imperative code block


#1

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>;
}
}


#2

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


#3

//Define a funcion

def boo(x)

{

return=[Imperative]

{

if(x>3)

{

return=true;

}

else

{return=false;

}

}

}

 

//Call the function

boo(3);

Dyn-20141231-1


#4

Thank you