Jump to content
Sign in to follow this  
cudarsjanis

[SOLVED]Group name to string

Recommended Posts

Hi.

How could I convert primitive group name to a string attribute?

I have few groups - group _01/02/03/.... and I just want to get numbers to use them as integers in vex, just to apply random color.

int group_number = opdigits(@name);

@Cd = set(rand(group_number), rand(group_number*1502), rand(group_number/1560));

Doing it with the name SOP, but what is the way of doing that in vex?

Thank you

Cheers

Janis

Share this post


Link to post
Share on other sites

some info about this can be found here

 

  • Thanks 1

Share this post


Link to post
Share on other sites
20 hours ago, anim said:

some info about this can be found here

 

Thanks a lot.

this is what I used at the end.

string primgrps[] = detailintrinsic(0, "primitivegroups");
s[]@primingrps = {};

foreach(string grp;primgrps){
    if (inprimgroup(0, grp, @primnum)) append(s[]@primingrps, grp);
}

int group_number = opdigits(s@primingrps[0]);
@Cd = set(rand(group_number), rand(group_number*1502), rand(group_number/1560));

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
Sign in to follow this  

×