Hi, thanks! It works.
int prim;
vector uv;
int firstPt = primpoint(0, @primnum, 0);
vector firstPtP = point(0, "P", firstPt);
string grp = "!* ^"+itoa(@primnum);
float dist = xyzdist(0, grp, firstPtP, prim, uv, 0.0000001);
if (prim != -1) v@Cd = {1,0,0};
However performance is much slower then the previous way. Instant cook vs 4 seconds in this case, maybe using this primgroup parameter is not that efficient.
I am still curious about this syntax !* ^240 - how would you explain it?
* ^240 means: check against everything, but primitive 240
! means inversion, like in blast sop: delete non selected, so wouldnt it negate the * symbol? Like that: !* == (nothing)
However, if I leave out !*, then it doesn't work. Hmm...