MikeRhone Posted July 5, 2016 Share Posted July 5, 2016 Hey guys, I've hit a bit of a wall on how to best approach this. I have multiple items with "objName" attributes - These are prefixed with the name I want to break out and group by. IE: objName: CarA_hood CarA_roof CarA_left_mirror CarB_windshield CarB_left_rear_tire CarC_hood CarC_left_rear_tire Using this attribute I wish to make groups: CarA, CarB, CarC. Is there an easy way to do this? I thought I might have luck in VOPS with a string split and pop node, but no dice. I've also tried doing it in a wrangle/python but I'm hitting a wall with the syntax. Quote Link to comment Share on other sites More sharing options...
fencer Posted July 5, 2016 Share Posted July 5, 2016 saw nice examples here Quote Link to comment Share on other sites More sharing options...
fencer Posted July 5, 2016 Share Posted July 5, 2016 (edited) or if you mean that) grouper.hip Edited July 5, 2016 by fencer 2 Quote Link to comment Share on other sites More sharing options...
MikeRhone Posted July 5, 2016 Author Share Posted July 5, 2016 Thanks a ton!!!! Your wrangle code shows me exactly where I was messing up. I was trying to dump the output of the split directly into an attribute instead of keeping it a variable (as in your example). Exactly what I was looking for, thank you! //s@x[] = split(s@title, "_"); <-- What I was doing wrong string x[] = split(s@title, "_"); //Correct setpointgroup(0, x[0], @ptnum, 1, "set"); //Awesome s@item = x[0]; //Drop it into a point attr for good measure 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.