CAB,
I used to have the same problem in a routine I used a while back. I don't remember which routine it was or what it did, but I know it would go haywire if I tried to run it in a non world UCS. What I did was store the current UCS, change it to WORLD, run routine, then restore the UCS. It may not be what you want to do but it may be a solution for you.