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]
NowâŚ
model=Sketchup,active_model
model.set_attribute("mamjankowski", "some_array_data", an_array)
Then later on
model=Sketchup,active_model
array = model.get_attribute(âmamjankowskiâ, âsome_array_dataâ, )
Provided that the arrayâs data is in the same order itâs easily extractedâŚ
1 Like
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âŚ