Any reason you want to query the HUD instead of getting total poly face count through other means?
Here’s a super simple way of doing so with PyMEL
import pymel.core as pm
sel = pm.ls(g=1) # get all scene geometry
totalFaces = sum([len(x.f) for x in sel]) # find sum of all scene geometry face counts
print totalFaces
# Error: line 1: AttributeError: file F:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core
odetypes.py line 332: nt.NurbsSurface(u'nurbsPlaneShape1') has no attribute or method named 'f'
#
Here’s the modified code that will work if there are NURBS geometries in the scene:
import pymel.core as pm
sel = pm.ls(typ='mesh') # get all scene polygon meshes
totalFaces = sum([len(x.f) for x in sel]) # find sum of all scene mesh face counts
print totalFaces