Good morning,
I am trying to create a Value List (Grasshopper.Kernel.Special.GH_ValueList) with default items that are different from the ones in the Value List component.
Creating this via a user object is very straighforward and easy. Though, I would like to incorporate such a component in a GHA assembly.
My initial approach is to subclass GH_ValueList. The trouble is that the list of items for GH_ValueList is a private class attribute and it cannot be accessed from a subclass.
Is this restriction intentional? Is there any plan to modify this? Or am I completely missing the right way to create a Value List with different default items.
Regards,
Guillaume Florent
David Rutten
Hi Guillaume,
Most of my custom objects were not designed to be subclassed. GH_ValueList does have a public property that allows you to add/remove items to the list of constants. ListItems simply returns that private list. You can access this property whether you've subclassed the value list or whether you're trying to modify an existing value list.
--
David Rutten
david@mcneel.com
Tirol, Austria
Jul 30, 2013