.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I use acdbmgd.dll and acmgd.dll from an executable project?

5 REPLIES 5
Reply
Message 1 of 6
dancalgary
788 Views, 5 Replies

How can I use acdbmgd.dll and acmgd.dll from an executable project?

I am new in VB.NEt programming
As i understand if I make an dll program referencing the mgd files I can run it from autocad and I am able to use transactions and so on
But if I create an executable project (Windows form application) the only way I know is by the following code:

Dim Acadapp As Object
Acadapp = System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")

And from here I can add objects like in VB6
How Can I access the transaction manager from this COM object?
Or it is not possible?

Thanks
5 REPLIES 5
Message 2 of 6

My understanding is that you can only access the COM components from an external app, because your app is not running under AutoCAD's AppDomain, and most/all of the managed methods, are what I would call 'not thread safe'. This applies particularly to those methods dealing with transactions and garbage collection (dispose).
Dave O.                                                                  Sig-Logos32.png
Message 3 of 6
Anonymous
in reply to: dancalgary

Not possible.

AutoCAD's .NET API is only available to extensions that are loaded into
AutoCAD using NETLOAD.

You can purchase a RealDwg license and use the Database-level part of the
API from a standalone executable, but the cost is quite rediculous.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6271464@discussion.autodesk.com...
I am new in VB.NEt programming
As i understand if I make an dll program referencing the mgd files I can run
it from autocad and I am able to use transactions and so on
But if I create an executable project (Windows form application) the only
way I know is by the following code:

Dim Acadapp As Object
Acadapp =
System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")

And from here I can add objects like in VB6
How Can I access the transaction manager from this COM object?
Or it is not possible?

Thanks
Message 4 of 6
Anonymous
in reply to: dancalgary

I think you're confused.

Autodesk specifically prohibits AutoCAD DLLs from being loaded into another
process, because they charge a lot of money for the ability to do that
(RealDWG).

It has nothing to do with 'thread safe' or dispose or transactions or
garbage collection.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6271543@discussion.autodesk.com...
My understanding is that you can only access the COM components from an
external app, because your app is not running under AutoCAD's AppDomain, and
most/all of the managed methods, are what I would call 'not thread safe'.
This applies particularly to those methods dealing with transactions and
garbage collection (dispose).
Message 5 of 6
dancalgary
in reply to: dancalgary

Thanks a lot for the answers.
But I have another one
Wich way is faster?
Using a com reference or using .net references?
I am having a database, I want to query it and to draw some lines based on the query result
Message 6 of 6
Anonymous
in reply to: dancalgary

You can't use .net references from an out-of-process client, so the question
is moot. From within AutoCAD, .NET is faster than COM.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6272038@discussion.autodesk.com...
Thanks a lot for the answers.
But I have another one
Wich way is faster?
Using a com reference or using .net references?
I am having a database, I want to query it and to draw some lines based on
the query result

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost