As you’ve found, there’s no easy way to do this. The suggestion posted by JRoC is probably as good a way as any.
However, in case it’s of interest, here’s a way to check for groups in an OBJ file, using just zscript. (A dll would be quicker!) I found there are issues reading strings when the file size gets large (over about a million polys), which is why I split it into chunks. (I’ve not managed to find out what restriction causes ZBrush to stop reading the string.) Also I use a rough-and-ready method to start reading in the middle of the file as ZBrush always writes the faces after the vertices.
This is a bare bones solution which doesn’t do any error checking. It would be probably sensible to export the lowest res, if there is one.
It doesn’t check for parts. That would involve using Auto Groups in a similar way to JRoC’s solution. It’s perhaps also worth pointing out that you can have groups and parts together!
[IButton,CheckGroups,“Check a mesh for PolyGroups”,
//set export options (should be reset after)
[IUnPress,Tool:Polypaint:Colorize]//don’t want polypaint exported
[IUnPress,Tool:Export:Txr]//don’t want texture coords exported
//export the OBJ
//load into memory
[VarMul,fSize,1024]//file size in bytes
[Mesh3DGet,0,pnts]//number of points
[If,fSize > 65536,
[VarSet,fOffset,INT(pnts*25)]//approx total bytes for vertex lines
[VarSet,lpNo,INT((fSize - fOffset)/bytesToMem)]
[MemDelete,ZZ_OBJMem]//make sure this isn’t around
//load chunk of file into memory
//read all the strings in the chunk
[If,offset >= [MemGetSize,ZZ_OBJMem],[LoopExit]]
[If,([StrFind,"g ",objLine] == 0),
[If,grp1OK,//if it’s the first group we’ve found
[VarSet,grp1OK,0]//make sure we only record the first time
, //else check for different group
[If,([StrLength,group1]==[StrLength,objLine])&&([StrFind,group1,objLine] == 0),
//same group - do nothing
,//else we have a new group
[LoopExit]//we don’t need to check any more
[VarAdd,fOffset,bytesToMem]//offset for next chunk
[If,fOffset >= fSize,[LoopExit]]//exit if end of file
[If,grps,[LoopExit]]//exit if groups found
[Note,“There are groups”]
[Note,“There are NO groups”]