Is there a RhinoCommon equivalent to Rhino's "What" command?

I’m looking for a way to return the number of vertices in a closed polysurface. Using the What command displays the information I need, but I need to be able to work with the results in a script. Any suggestions?


The only information I need is highlighted above.



Once you have a polysurface (Brep), you would walk through each face in the brep using the Faces property. For each face, call GetMesh and if a mesh exists call mesh.Vertices.Count

Thanks Steve. I’ll give that a try.

Hi @DanBayn,

This might also be useful:

import Rhino

def test_what():
    filter = Rhino.DocObjects.ObjectType.Surface | Rhino.DocObjects.ObjectType.PolysrfFilter
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select surface or polysurface", False, filter)
    if rc == Rhino.Commands.Result.Success:
        rhobj = objref.Object()
        if rhobj:
            log = Rhino.FileIO.TextLog()

if __name__ == "__main__":

– Dale

Thanks Dale.