Hi there,
I am trying to store some data into an attribute dictionary, adding the items to it, and trying to retrieve the data back but I am getting nil values. Below is the sample code describing what I am trying to do.
module Test
def initialize()
@@groups_dictionary = Sketchup.active_model.attribute_dictionary('groups_dictionary', true)
@@groups_dictionary["groups"] = []
end
def add_new_group(group_name)
new_group = { :value => group_name, :text => group_name }
groups = @@groups_dictionary["groups"]
groups << new_group
@@groups_dictionary["groups"] = groups #@@groups_dictionary["groups"] seems to be immutiable so I am gettting the current values and rewriting
end
def get_all_groups()
groups = @@groups_dictionary["groups"] # here @@groups_dictionary["groups"] is returning [nil]
end
end
What am I doing wrong, any points to achieve this?