Grasshopper

algorithmic modeling for Rhino

Hi David


Given an output param that is part of a component, what is the correct way to get a reference to the component instance itself? Is it possible or are there some catches?

Thanks,

Giulio

--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Views: 333

Replies to This Discussion

There is no direct way to do this, you'll have to travel via the attributes:

IGH_Component owner = Attributes.GetTopLevel.DocObject as IGH_Component;

and this only works if the component and the parameters are part of a visible document, otherwise the Attributes are not guaranteed to exist.

--

David Rutten

david@mcneel.com

Seattle, WA

Thanks!

--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

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