How can I query how many subobject edges the Rhino.DocObject.BrepObject has?

Hi there,

How can I query how many subobject edges the Rhino.DocObject.BrepObject has?

(I know I can use Subobjectselect in a loop and when it finish I can get it, but is there other way?)

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_RhinoObject.htm

import Rhino
def BrepEdgesCount():
    filter = Rhino.DocObjects.ObjectType.Brep
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select a Brep", False, filter)
    if rc != Rhino.Commands.Result.Success: return rc
    if not objref: return Rhino.Commands.Result.Failure
    brep = objref.Brep()
    if not brep: return Rhino.Commands.Result.Failure
    print brep.Edges.Count
    return Rhino.Commands.Result.Success
if __name__ == "__main__":
    BrepEdgesCount()

BrepEdgesCount.py (479 Bytes)