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!
Tags:
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
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by