Code Red > .NET

Error in 'CreateFloatingViewport' help sample


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:  if anyone is interested.

live long and prosper.

Alternate solution from Gilles
and revised code for multiple Viewport creation ( to avoid Acad crash )


[0] Message Index

Go to full version