Jump to content

Is there a way to stop a Foreach SOP?


Recommended Posts

Hi,

 

I noticed Foreach SOP has a Stop Condition parameter but there is no example that I could find. For example can I stop it when a detail attribute has a certain value or when a group has no elements inside?

 

It mentions something about stamping but I don't know what I can stamp? Should I be stamping the each node inside?

 

 

Thanks :)

Link to comment
Share on other sites

one use  of stop condition that I know is to visualize output of each iteration. Write stamp(".","FORIDXVALUE",0)>$F in stop condition. If this value evaluates to zero it will continue not otherwise.  If you compare this with a detail attribute , it should work.

  • Like 1
Link to comment
Share on other sites

try detail("../foreach1/attribwrangle1","aa",0)>30 in stop condition.

Now value of "aa" is not going beyond 30.

I never used it this way before. Not sure if this is the solution or it will work in all the cases. Will do more tests once I get little free time.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

This example is working but you should prefix your attribute references in AttribWrangle with the right type, which in your case is i, so i@c, i@stop. I don't know if this could your issue in your other file but something to keep an eye on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...