Grasshopper

algorithmic modeling for Rhino

If i know a rhino object's ID,how can i select it in grasshopper?

I just can't find this method in rhinocommon sdk.Anyone help?

Views: 2390

Replies to This Discussion

Rhino.RhinoDoc.ActiveDoc.Objects.Find(obj_id)

Or you could just feed an ID into a Geometry parameter and have Grasshopper resolve the object.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks for your reply,david.
But the "find" function returns rhino object,I want a "select"function that make the rhino object selected(hignlighted in rhino),because I want to run a rhino command in the script.
Rhino.DocObjects.RhinoObject ro = Rhino.RhinoDoc.ActiveDoc.Objects.Find(guid);
ro.Select(true);

The RhinoObject has a method for selecting, it's overloaded for other selected behaviour.

Cheers,

Jon
yeah,it works!!Thank you!!
Just wonder why there is no select(obj_id) function,which will make things much easier..
It's a balance between stuffing the namespaces full of methods that make individual things easier but make it impossible to find what you're looking for and providing a minimal SDK that looks very clean but requires a lot of steps to achieve something.

There's no hard and fast rule we apply, but I think having Select methods on both the Document (or the Objects list) and Rhino objects is confusing.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
I'm trying to do the same thing in vb.net (baked is a list of Guid):
For k As Integer = 0 To baked.Count() - 1
Dim ro As Rhino.DocObjects.RhinoObject = Rhino.RhinoDoc.ActiveDoc.Objects.Find(baked(k))
ro.Select(True)
Next
but I get an invalid token error every time I add the line:
.Dim ro As Rhino.DocObjects.RhinoObject = Rhino.RhinoDoc.ActiveDoc.Objects.Find(baked(k))
Is my syntax off?
would it possible for you to post the final component? i'd like to check it out if you don't mind. thanks.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service