.
Say I have a simple class A, that has a list property called SomeList:
public class A { public A() { SomeList = new List<string>(); SomeList.Add("_init"); } public List<string> SomeList { get; set; } }
Now I make a custom parameter for this class as we discussed in the other question:
(http://www.grasshopper3d.com/forum/topics/custom-parameter-base-class-type-for-input?xg_source=activity)
I have a component (left in the picture below) that initializes the class A and passes it to the DA.SetData output as a GH_AParam.
(I pass the 'SomeProperty' list to the DA.SetData output in each of the components to show what is happening to this class property)
Now I have an operator component that adds an "ITEM" to this property list. In the initial component the class number 1 is made and has stage 0 so (1.0). When I operate on this original parameter the stage number is increased with one so (1.1) and so it progresses as (1.++) downstream. In other words the SomeList property should progress in the first stream as:
(1.0) SomeProperty:
0 _init
(1.1) SomeProperty:
0 _init
1 ITEM
(1.2) SomeProperty:
0 _init
1 ITEM
2 ITEM
When I create a new stream from the original I would like to take again the initial value from the initial component in other words; Duplicate stage (1.0) to a new one (2.0) as:
(2.0) SomeProperty:
0 _init
(2.1) SomeProperty:
0 _init
1 ITEM
However the operator on the second stream gives me the latest version of the class.
I have tried getting the Volatile data from the GH_InputParamManager input parameter of each of the components but this still always gives me the most updated version of this parameter.
Since you basically do this with all your parameters I was wondering if there is an override property you can set in a custom parameter so that it always returns the 'local' state of the parameter in every component instead of the 'current' state.
I hope this is clear and thanks in advance!
Dion…
Added by Dion Jansen at 12:57pm on August 27, 2013