ZBrushCentral

Is current tool 3d mesh?

Hi.
In my script I want to check if it is possible to activate Edit Mode at this time.
For example, if currently selected tool is 2d brush or 3d mesh but not yet drawn we can`t go to Edit Mode. How to get around error in script?