in
https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-61C22902-F63B-4204-86EC-FA37312D1B6ECreate Paper Space Viewports (.NET)The Dll Import should be from "accore.dll" NOT from "acad.exe"
and the entry point is incorrect.
The following options work for me in ac2023
//---------------------------------------------------------------------------
[DllImport("accore.dll", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@PEBVAcDbViewport@@@Z")]
extern static private int acedSetCurrentVPort(IntPtr AcDbVport);
//---------------------------------------------------------------------------
[DllImport("accore.dll", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "?acedSetCurrentVPort@@YA?AW4ErrorStatus@Acad@@H@Z")]
private static extern int acedSetCurrentVPort(int acDbVportNumber);
//---------------------------------------------------------------------------
I imagine there are a few others that have been incorrect for about 9 years or so.
The current Dumpbin output is here:
https://www.theswamp.org/index.php?topic=41527.msg613345#msg613345 if anyone is interested.
live long and prosper.