btraemoore Posted April 25, 2013 Posted April 25, 2013 okay, im trying to get a connection to 2006 and im having problems. i used keen(through the interface) example and its throwing a COM exception, BUT it is creating the instance of autocad. I dont think it is connected to it, but it creates it. NOW, when i downloaded the objectARX for 2006 there where no interop.dll's just the 3 "acdbmgd" variations... im just learing how to work with c#. Can some one throw me a little bone here here is my code. public MainForm() { InitializeComponent(); IMessageFilter oldFilter = default(IMessageFilter); CoRegisterMessageFilter(this, oldFilter); AcadApplication acApp = GetAcApp("AutoCAD.Application.16.2"); } public AcadApplication GetAcApp(string progID){ AcadApplication acApp = null; try { acApp = (AcadApplication)Marshal.GetActiveObject(progID); } catch { try { Type acType = Type.GetTypeFromProgID(progID); acApp = (AcadApplication)Activator.CreateInstance(acType,true); } catch { MessageBox.Show("Cannot create object of type \"" + progID + "\""); } } if (acApp != null) { // By the time this is reached AutoCAD is fully // functional and can be interacted with through code acApp.Visible = true; return acApp; } return null; } Quote
BlackBox Posted April 25, 2013 Posted April 25, 2013 It sounds like you're attempting to create a stand-alone EXE, in lieu of a plug-in (an assembly that is loaded into an active session of AutoCAD), is this correct? If instead you're after a plug-in, and you're already coding in C#, why not just use the .NET API (AcDbMgd.dll, AcMgd.dll) in lieu of COM? Quote
btraemoore Posted April 29, 2013 Author Posted April 29, 2013 I would like to learn both using the .NET API and COM. I have had a really hard time finding some good examples that explain verbosely about both. If you know where i can find any i would be very appreciative. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.