Grasshopper

algorithmic modeling for Rhino

Hello,

 

does anyone know how i can sleect an exisitign compnent from its GUID?

 

For example

 

Dim ghComponent As Grasshopper.Kernel.IGH_Component

 

 

how do I select and existing component form its guid?

 

cheers

 

steve

Views: 237

Replies to This Discussion

You must go via the GH_Document in order to get a reference of the Object if all you have is the ID.

Are you doing this from within a VB component?


Dim doc As GH_Document = owner.OnPingDocument()
Dim obj_id As New guid("0a86a903-4b53-4f7a-a982-342d9e56d6d8")

Dim obj As IGH_DocumentObject = doc.FindObject(obj_id, True)
If (obj IsNot Nothing) Then obj.Attributes.Selected = True

GH_InstanceServer.RegenCanvas()


--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks David, this should solve my problem,

Steve

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