
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I want open DWG file by AutoCAD command. There are two methods Application.DocumentManager.MdiActiveDocument.SendStringToExecute() and C++ acedCmd() implemented as follow: [DllImport("accore.dll", EntryPoint = "acedCmd", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)] private extern static int acedCmd(IntPtr rbp);
But i don't know how to write the correct code.
I have tried the following code, but ITdoes not work.
(1) ResultBuffer rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_.OPEN D:\\1.dwg"));
if (!AcadApp.DocumentManager.IsApplicationContext)
acedCmd(rb.UnmanagedObject);
(2)AcadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("OPEN D:\\1.dwg ", true, false, true);
Anybody can help me.
Solved! Go to Solution.