Moving an instance by swapping the transform

Hi Jill,

One thing is the:
id0 = Rhino.ObjectsByLayer("Source", True)

will always return an array, even if there is only one object on that layer.

So if you try this:
xf0 = rhino.BlockInstanceXform(id0)
you get an error because you feed an array where it expects a string (objectID)
so you would need to do:
xf0 = rhino.BlockInstanceXform(id0(0))
to get 1st element of the array, or iterate through all objects in the returned array if there is more on that layer.

hope that makes sense. I didn’t test or look at the rest. this is the first thing that jumped at me.

–jarek

@Jarek - That did it! You’re great at explaining things in simple term. Thank you very much.
@Emilio - Thanks for the script and all your help too.

Saved again by the wonderful folks on the forum!

~J

1 Like