cudarsjanis Posted November 20, 2019 Share Posted November 20, 2019 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 Quote Link to comment Share on other sites More sharing options...
anim Posted November 20, 2019 Share Posted November 20, 2019 some info about this can be found here 1 Quote Link to comment Share on other sites More sharing options...
cudarsjanis Posted November 21, 2019 Author Share Posted November 21, 2019 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)); 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.