Using VEX with variables to construct commands

   2158   1   0
User Avatar
Member
40 posts
Joined: 7月 2009
Offline
Hello
I was curious about trying to make a procedurally created set of point groups
using vex wrangle - but i cannot find a way to execute the last command as a legal entry:

i@test = int(rand(@id)*10);//creates int test with values 0-9 randomly on your points.

//this is the pseudo code :
i@group_group_@test=1; // to make all the groups in one line.

Im assuming there may be a way via an addattribute ? + a string concat to sprintf the group creation with the attribute suffix…
User Avatar
Member
40 posts
Joined: 7月 2009
Offline
Never mind resolved it:

————————-
//assign points to groups by rand:
int i = int(rand(@ptnum)*10);
string grp = sprintf(“group_%d”, i);
setpointgroup( geoself(), grp, @ptnum, 1, “set”);
  • Quick Links