I am using ghPython and Rhino common to get the xform location of an instance object and the layer indicies of its sub-objects.
I am coming across an error stating that 'This object cannot be modified because it is controlled by a document.' I am not trying to modifty the object just get the layerIndex attribute.
Here is a section of the code, my rhino file consists of several blocks, each with several mesh objects inside.
Any help from the forum is greatly appreciated!
instanceTable = Rhino.RhinoDoc.ActiveDoc.InstanceDefinitions.GetList(True)
for instance in instanceTable:
instRef = instance.GetReferences(0)
print str(len(instCopy)) + ' number of instances'
for ref in instRef:
refXform = ref.InstanceXform
refAttr = ref.Attributes.LayerIndex
refCount = ref.MeshCount(Rhino.Geometry.MeshType.Any,None)
print str(refCount) + ' number of meshes in instance'
refSubObj = ref.GetSubObjects()
for s in refSubObj: