Hi,
I have a script which takes a face and fits a grid to it. I tried to store information about the grid so that other scripts can analyse it. In particular, I have a 2D (so that the objects can be accessed with x and y coordinates) array called nodes which contains a set of Point3d objects, which I stored with:
grid.set_attribute("grid_properties", "nodes", nodes)
This worked fine, but when I similarly try to store a 2D array called cells which contains a lot of faces, i.e. it looks like:
[ [Face, Face, ...] , [Face, Face, ...] , ... ]
what gets stored is the array with all faces replaced by nil, i.e.
[ [nil, nil, ...] , [nil, nil, ...] , ... ]
The cells array itself is not affected. To demonstrate, I have the following code in my script:
puts cells
grid.set_attribute("grid_properties", "cells", cells)
puts grid.attribute_dictionaries["grid_properties"]["cells"]
The output from the console is then something like:
#Sketchup::Face:0x1ac7e9fc
#Sketchup::Face:0x1ac7e984
#Sketchup::Face:0x1ac7e90c
#Sketchup::Face:0x1ac7e894
#Sketchup::Face:0x1ac7e81c
#Sketchup::Face:0x1ac7e7a4
#Sketchup::Face:0x1ac7e72c
nil
nil
nil
nil
nil
nil
nil
Help?