Grasshopper

algorithmic modeling for Rhino

Hi!

A have a component derived from GH_Param and, in response of some events, i want clear all data inside parameter. (The same effect of Clear Values menu option)

I'm using GH_Param::ClearData() but, after this call, the component remains intact.

Do I need some other action after ClearData?.

I'm using too GH_Param::ExpireSolution(true/false) after ClearData() without success.

Thank you very much!

Views: 642

Replies to This Discussion

GH_Param<T>.ClearData() will erase all runtime messages, set the solution phase to Blank and it will also erase the m_data field, which is where a parameter keeps its volatile data.

The Clear Values menu item erases the persistent data, which is data permanently stored inside the parameter. If a parameter has persistent data and no sources, then during a solution the persistent data will be copied into the volatile data. To clear this data you need to derive from GH_PersistentParam<T> and then call param.PersistentData.Clear()

And you will have to call ExpireSolution as well to make it all work. If you use ExpireSolution(false) then you'll need to trigger a new solution later on as well.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service