.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
.Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm trying to build an application that will write to the properties of Autodesk files. I have the iProperties for inventor files working and now I'm trying to do AutoCAD. I've found many examples of code but can't test anything because of my problems. I've seen two places to find the dll's, one is from the application directory c:\ProgFiles\AutoDesk\AutoCAD xxxx. Others are saying to download and pull from ObjectARX 2013. I get strange errors when I try and use these dll's.
If I use ObjectARX I get this... "Common Language Runtime detected an invalid program."
If I use the application directory I get this... "Could not load file or assembly 'accoremgd,..."
I'll be trying to do something like the following and it fails every time
Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.D
Here are the assemblies that I'm working with...
AcCoreMgd.dll
AcDbMgd.dll
AcMgd.dll
I'm clearly missing something here. Please help.
Thank you in advance.
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
what version of AutoCAD do you use?
what version of Visual Studio do you use?
what Framework have you set to your project-Framework?
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Per chance, are you writing a extension dll for AutoCAD, or a standalone application?
AutoCAD's managed dlls are only usable from a .NET extension DLL that gets loaded into AutoCAD.
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Alfred
AutoCAD 2013
VS 2010
.Net 4.0
Thanks,
Neil
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No I'm writing a standalone application.
I'm not sure I understand what you mean regarding the use of the DLL's, can you explain?
Are you saying that the DLL's cannot be consumed by a standalone application?
Thanks for the help.
Neil
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
>> If I use ObjectARX [...]
Do you mean by this where your referenced DLL's are from? I always use the DLL's from the AutoCAD installation directory (but I know that Stephen Preston always says that the DLL's from the ObjectARX-kit should be referenced).
And just to make sure: you have downloaded the ObjectARX for AutoCAD 2013?
>> Could not load file or assembly 'accoremgd,...
Is it possible that you have:
- your application on a network-drive
- you have set "yes" to the "local copy" property of the refernces?
Sometimes during development I saw that cleaning the output-directory, restarting VS and fully recompile the solution was necessary to get it running again (especially if you have multiple projects open using same source(parts), ==> try that also!
Good luck, - alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
ok, our posts crossed ![]()
>> No I'm writing a standalone application.
you can use DLL's, of course, but only the ones that are loaded into AutoCAD can use the mananged API.
If you have an EXE that starts AutoCAD and than uses _NETLOAD (or something like demand-loading) to load a special DLL into AutoCAD, then it's ok for using the managed API (and referencing the *mdg.dll).
If you have an DLL from outside AutoCAD then you can just use the COM-objects API, not the managed one.
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
neilfl wrote:No I'm writing a standalone application.
Are you saying that the DLL's cannot be consumed by a standalone application?
Right.
AutoCAD's managed DLLs are provided as managed wrappers for accessing functionality in AutoCAD. They can't be used remotely, only from extension DLLs that are loaded into AutoCAD's process.
The only way to interact with AutoCAD from another process is via it's ActiveX API.
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
DP, where can I find documentation on using ActiveX API for AutoCAD and extension dll's from AutoCAD process?
Re: .Net DLL Help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
@neilfl: You mentioned that: I've found many examples of code but can't test anything because of my problems.
Where did you find examples of code? Can you give me the link? I also need to practice.
Thanks in advance.


