Loop nodes

Loop node is a kind of Control nodes. In fact two nodes represent Loop: start loop and end loop nodes. Nodes of such type are always InLine nodes. User have to supply this type of node by service, which will check conditions of end of loop.

With that kind of nodes you may define all kinds of loops:

“for( initial condition(s) ; end condition(s) ; end loop code )” or

“while( end condition )”

etc…

 

 

 

To create a Loop node you have to define three python functions which will manage the loop with all input and output arguments (ports) defined  in the node :

 

 

 

 

Setting of these functions is possible from the standard Add Node dialog box (see also Adding nodes):

 

                       

 

Here you can see a simple example of Python functions set in a Loop node:

 

def Init(Index,Min,Max,Incr) :  

    if Min <= Max :  

        Index = Min  

    else :  

        Index = Max  

    return Index,Min,Max,Incr  

 

def More(Index,Min,Max,Incr) :  

    if Index < Max :  

        DoLoop = 1  

    else :  

        DoLoop = 0  

    return DoLoop,Index,Min,Max,Incr  

 

def Next(Index,Min,Max,Incr) :  

    Index = Index + Incr  

    return Index,Min,Max,Incr

 

Loop nodes have the following particularities:

 

 

 

 

Related Topics