I am writing a python plugin that writes data to the UserDictionary (as in previous topic) for different curve objects, and am hoping this data gets saved along with the document. However, I am receiving this error upon saving:
Failed to write 3dm file instance definition table
I am not sure what is causing this error, could this potentially be a bug?
import Rhino as r
import rhinoscriptsyntax as rs
import cPickle as cp
import System.Byte as Byte
import System.Collections.Generic.IEnumerable as IEnumerable
obj1Id = rs.GetObject("object A")
obj2Id = rs.GetObjects("objects to store in A")
if obj1Id and obj2Id:
baseobj = rs.coercerhinoobject(obj1Id)
storedGeometry = []
for item in obj2Id:
storedGeometry.append(cp.dumps(rs.coercerhinoobject(obj1Id).Geometry))
baseobj.Attributes.UserDictionary.Set.Overloads[str,IEnumerable[Byte]]("StoredGeometry",storedGeometry)
@dale Here is a simple script that recreates the error upon saving.
@dale using this function still results in the same error upon saving when storing the byte array in the user dictionary of an object (still using “obj.Attributes.UserDictionary.Set.Overloads[str,IEnumerable[Byte]]”)