Jump to content

create group with wrangle from @class using "iteration" in foreach


Recommended Posts

I'm trying to create groups with a wrangle from @class attrib after a connectivity sop, using "iteration" attrib in a foreach loop. 

f@group_`"detail("../foreach_begin1_metadata1/", "iteration", 0)"` = @class;

I was thinking the backticks and quotes should resolve to the iteration number as a string. then concatenate it to the f@group_ and that equal to class number. However i think the iteration and class atribs are integer values and the f@group has to be a float?

confused...

Link to comment
Share on other sites

If you specifically want to do it inside a for each, this will work (metadata must be plugged into second input):

setpointgroup(0, sprintf("group_%i", int(detail(1, "iteration", 0))), @ptnum, 1, "set");

*edit : presuming you're using class as your piece attribute

Edited by j00ey
Link to comment
Share on other sites

1 hour ago, j00ey said:

If you specifically want to do it inside a for each, this will work (metadata must be plugged into second input):

setpointgroup(0, sprintf("group_%i", int(detail(1, "iteration", 0))), @ptnum, 1, "set");

*edit : presuming you're using class as your piece attribute

sprintf thats right. thank you. 

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...