The ZScript language is pretty crude but it does have some of what you’d need. If you can repro your steps manually with the script recorder (under the ‘Zscript’ menu) on you’ll be able to see the relevant command.
Unfortunately there’s no easy api for inspecting faces – the Mesh3DGet
command will give you some info about the currently selected tool, but I think it’s limited to global info (ie, vert count) rather than specifics about a particular vertex or face.
If you write a C++ plugin, the api passes a pointer-to-pointer for a block of bytes in memory; I’m not sure what that’s for (it’s not documented, AFAICT) – it might be a pointer to the current image (which would not be useful) but it might be a pointer to active tool, I’m not sure. The signature of an external method looks like this, where the char* arguments pointers to 255-byte blocks (of characters). Like I said, the char ** Zdata
argument isn’t documented but it isn’t passed, maybe you could deduce it you had a simple tool like a cube active.
float DLL_EXPORT ExternalCommand(char* SomeText, double OptionalDouble, char* SomeMoreText, int SomeMoreTextSize, char* ReturnBuffer, int ReturnBufferSize, char** zData);