Save an array with skp file


Is there possibility to save an array (with data) with skp file?
And after reopen skp restore data from array?


Have a look at AttributeDictionary


First set up your array:

an_array=['a', 'b', 1, 2, 3.0123, true, false, another_array]


model.set_attribute("mamjankowski", "some_array_data", an_array)

Then later on

array = model.get_attribute(“mamjankowski”, “some_array_data”, [])

Provided that the array’s data is in the same order it’s easily extracted…


Thanks, it works.
I thought that in model attributes is not allowed to store an array.
I was wrong.


Most ‘objects’ in Sketchup can be given attributes [which can then be ‘retrieved’] - typically you might think of ‘containers’ like groups and component-instances, and of course raw geometry like edges and faces, but it can include the model-itself, and then its layers, definitions, materials, scenes etc, or their sub-parts like a definition etc…