Code Red > .NET

Error in 'CreateFloatingViewport' help sample

(1/1)

kdub_nz:
in https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-61C22902-F63B-4204-86EC-FA37312D1B6E
Create 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


--- Code - C#: ---     //---------------------------------------------------------------------------      [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.

kdub_nz:
Alternate solution from Gilles
and revised code for multiple Viewport creation ( to avoid Acad crash )
https://forums.autodesk.com/t5/net/error-in-createfloatingviewport-help-sample/m-p/11811120/thread-id/76182#M76185

Navigation

[0] Message Index

Go to full version