Nemiko 1 Posted November 7, 2020 Guys, please help, I can’t understand how to write the conditions for creating groups, so that after deleting a primitive, a group is created for primitives that have been deleted and those that have not been deleted Share this post Link to post Share on other sites
RogerW 3 Posted November 11, 2020 Hi Nemiko, Just from your example, In the first line of your code you are comparing a string to and int which wont work, You also cant add a primitive to a group if it doesnt exist, So to simplify things I would first add the prims that you want to delete to a group then delete them outside of thte wrangle. In your second if statement you are also using @ptnum where the function is expecting a primitive number (@primnum). There also seems to be a mixture of incorrect attribute types. Not knowing the full context, I would say that your wrangle should look more like ths : if ( @name == "-1") { setprimgroup(0,"myprimgroup",@primnum,1,"set"); } this will add any prim to the the group "myprimgroup" that has an attibute value of "-1" for the name attribute. Then you can just delete it after the wrangle. Hope this helps R Share this post Link to post Share on other sites