Jump to content
bonassus

vex groups from string parameter

Recommended Posts

If I have a string parameter assigned to each point of an object can I create a group for each point using it?

s@s = sprintf("%i",i@ptnum);
f@group_s = @s ???

thanks,

Share this post


Link to post
Share on other sites
string s = sprintf("point_%d",@ptnum);
setpointgroup(0, s, @ptnum, 1);

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Okay, thanks a lot. I see now in the help card that the last parameter, 1 is a value parameter. Is this a true false value?

Share this post


Link to post
Share on other sites
2 hours ago, bonassus said:

Is this a true false value?

Yes, you could do something like:

int grp = @Cd.r > 0.5; // returns 1 if red color above 0.5, 0 if 0.5 or less
setpointgroup(0, "red_group", @ptnum, grp, "set"); // sets group if grp is 1

 

Edited by konstantin magnus
corrected it ; )
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×