I got around it Mick.
// Change to Paperspace if not already there...
if (curDb.TileMode)
curDb.TileMode = false;
Editor ed = doc.Editor;
ErrorStatus es = ErrorStatus.OK;
// Are we in a paperspace viewport?
if (curDb.PaperSpaceVportId != ed.CurrentViewportObjectId)
acedPspace();
...and the import:
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedPspace@@YA?AW4ErrorStatus@Acad@@XZ")]
private static extern int acedPspace();
I actually wanted to switch to Paperspace and if in any viewports, get out of them. It doesn't appear they wrapped this functionality. A quick look in the '7 docs shows Editor.SwitchToModel and the equivalent for paperspace.
If you wanted to get into a viewport and then change to another I suspect you would have to import acedSetCurrentVPort like so:
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@H@Z")]
private static extern int acedSetCurrentVPort(int vpnumber);
You would have to get the viewport number from the viewport you wanted to switch to and pass it into acedSetCurrentVPORT.
This is for anyone else who is trying to do this...end of waffle.
Cheers,
Glenn.