Grasshopper

algorithmic modeling for Rhino

What would be an equivalent of SolveInstance Method in a GH_Param

Fellow GH_Users,

What is the closest method of the GH_Component.SolveInstance in a GH_Param object? In another word, how can I plug into a GH_Param to collect the output value once it has been computed. I found GH_Param.ComputeData() to be the closest but I cannot override it. 

I am trying to extract the value of some modified components/param after thay have been solved to send them somewhere else (implementing kind of document constant behavior through modified objects). It's working well in a component by placing a dedicated method at the end of the SolveInstance but a Param type object would be more appropriate. 

Thanks!

Views: 443

Replies to This Discussion

Try this:

protected override void OnVolatileDataCollected()

{

}

Excellent! And now, any idea how I can override the data which is passed downstream of the GH_Param? VolatileData is Read Only .

Thanks

Found something :  a protected field GH_Param.m_data which seems to contains the underlying data. Reassigning it at the end of OnValatileDataCollected seems to work but since there is no documentation I don't think that's the proper way of doing it... 

Cheers!

Exactly!

Meh, it's fine just so long as you do not assign a null to that field.

Typically what you'd do is modify the data inside the VolatileData instance, rather than create a new one.

Will do! Thanks David & Panda for the feedback.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service