Jump to content

VEX: if a point is not in any group, then add it to newgroup


Recommended Posts

I've checked group related vex functions, and found inpointgroup the closest to what I'm looking for but It's asking for a specific name of a group.

I may have a lot of groups, all I need is: for all the points that are "groupless" to be added to a new group called newgroup.

Link to comment
Share on other sites

What about something like this running in a point wrangle. Fetch all the group names from the intrinsic attribute where they are stored. Initially set all points to be in the "newgroup" group, then loop over the group names. If the point is in the fetched group, remove it from "newgroup."

i@group_newgroup = 1;
string groups[] = detailintrinsic(0, "pointgroups");
foreach (int i; string group; groups) {
    int check = inpointgroup(0,group,@ptnum);
    if(check==1){i@group_newgroup = 0;}
}

 

Edited by Atom
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...