Jump to content

Integer Attribute from Group Name


Recommended Posts

I have a string attribute which is referencing a parameter from the groupRename sop.  This string attribute is a detail attribute; problem is getting only the primitives for the group in a integer attribute.  I tried, although a little silly; the following in the same detail attribute; i@udim01 = atoi("udim_01"); obviously no success.  Therefore I tried placing the same line in another primitive wrangler, the results are empty.

How can I get only the primitives which belong to the group from the group Name parameter as an integer attribute for primitives ?

Link to comment
Share on other sites

40 minutes ago, CinnamonMetal said:

I read the thread, therefore shouldn't the following give me an array of all the primitives in GroupZero ?


string grp_01 = detailintrinsic(0,"GroupZero");
s[]@primGrp = {};
foreach(string grp01;grp_01){
    if(inprimgroup(0,grp01,@numprim)) append(s[]@primGrp,grp_01);
    }

 

dunno....but shouldn't you use expandprimgroup ?

int [] expandprimgroup(<geometry>geometry, string groupname)

 

btw, I think you should appending a 'number' to the array (ie. point index)...right now it looks like you're appending a string....but try expandprimgroup.

Edited by Noobini
Link to comment
Share on other sites

3 minutes ago, CinnamonMetal said:

if(inprimgroup(0,grp01,@numprim)) append(i[]@primGrp,grp_01); ?

Also expandprimgroup() does work; but want to know otherwise.

nah....the number...which is the same number that you tested for in inprimgroup

so if you're testing

inprimgroup(0,grp01,123)

ie. you testing if prim number 123 is in a certain group, then add the number 123 to your array so you  should be using @numprim

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...