Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

bonassus

vex groups from string parameter

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);

 

 

2 people like this

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 ; )
1 person likes this

Share this post


Link to post
Share on other sites

Thank you, did you leave out the point number parameter from your example?

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