There's the rub. You might solve that with
GetView(xAngleR, yAngelR, zAngleR, offsetX, offsetY, offsetZ);
SetView(0, 0, 0, 0, 0, 0)
SetView(xAngleR, yAngelR, zAngleR, offsetX, offsetY, offsetZ);
Or maybe not...
That's what i do now
I guesse that i need to follow ccroft's advice and write my plugin without changing the view, and that means 100 lines instead of 10. I just want to keep code clean and short