How to get the number of surfaces?

Hi,

When I select the surfaces I need to know the number of surfaces. eg.I select three surfaces and get the number is 3.

import rhinoscriptsyntax as rs


def do():
    msg="Select the surfaces get the number of surfaces"
    objectIds = rs.GetObjects(msg, filter=8, preselect=True)
    if not objectIds: return

do()

Thanks

Hi,

Use Python’s len() method to get the length of the selected objects list:



import rhinoscriptsyntax as rs


def do():
    msg="Select the surfaces get the number of surfaces"
    objectIds = rs.GetObjects(msg, filter=8, preselect=True)
    if not objectIds: return
    print len(objectsIds)

do()


Thank you.