MitchFields Posted February 26, 2019 Share Posted February 26, 2019 I have multiple lines, 25 primitives all containing a wide range of points. I want to append each point to a group depending on the primitive number. My initial code looks like this, int poop[] = primpoints(0,0) foreach(int i; poop) { i@group_primnum_0 = 1; } This function grabs all of my points, when I only want specific points for each primitive to create groups out of. How can I make this procedural to loop over all of my primitives and assign each array it's own group id? Thanks! Still new to vex >:{| Quote Link to comment Share on other sites More sharing options...
anim Posted February 26, 2019 Share Posted February 26, 2019 something like this? (Point Wrangle) setpointgroup(0, sprintf("primnum_%g", @primnum), @ptnum, 1); Quote Link to comment Share on other sites More sharing options...
MitchFields Posted February 26, 2019 Author Share Posted February 26, 2019 Oof I knew there was a way to use sprintf, this is assigning groups and then appending the prim id to the end of the group right? Does setpointgroup work the same way i@group does? Thanks! Quote Link to comment Share on other sites More sharing options...
anim Posted February 26, 2019 Share Posted February 26, 2019 this is essentially generating group name based on the primnum that the current point belongs to then just adds the current point to the group of such name i@group_groupname is usually more convenient and direct way to assign current point to specific group however you can't set group membership to other group than "groupname" and to other point than current (@ptnum) so in this case you want to use setpointgroup() because you can vary groupname per point if you want, also you'd want to use setpointgroup() if you want to set group membership to other point than current Quote Link to comment Share on other sites More sharing options...
MitchFields Posted February 27, 2019 Author Share Posted February 27, 2019 Ahhhhh okay I see, thank you Tomas. I've gotta get out of my comfort zone and start using setpointgroup more often. Thanks!!! 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.