Hi,
The SelectObjects() method is slow, due to it calling SelectObject() which is redrawing the view after each selction.
Could this be optimized to only redraw after all are selected?
Thanks
-Willem
def SelectObjects(object_ids):
"""Selects one or more objects
Parameters:
object_ids = list of Guids identifying the objects to select
Returns:
number of selected objects
"""
id = rhutil.coerceguid(object_ids, False)
if id: object_ids = [id]
rc = 0
for id in object_ids:
if SelectObject(id)==True: rc += 1
return rc
def SelectObject(object_id):
"""Selects a single object
Parameters:
object_id = the identifier of the object to select
Returns:
True on success
"""
rhobj = rhutil.coercerhinoobject(object_id, True, True)
rhobj.Select(True)
scriptcontext.doc.Views.Redraw()
return True