bonassus Posted March 1, 2018 Share Posted March 1, 2018 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... Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 1, 2018 Share Posted March 1, 2018 If you want to create groups from an i@class attribute, maybe just use the Partition SOP? Quote Link to comment Share on other sites More sharing options...
j00ey Posted March 2, 2018 Share Posted March 2, 2018 (edited) 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 March 2, 2018 by j00ey Quote Link to comment Share on other sites More sharing options...
bonassus Posted March 2, 2018 Author Share Posted March 2, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.