.NET

.NET

Reply
Contributor
AloyH
Posts: 12
Registered: ‎09-12-2012
Message 1 of 11 (1,561 Views)

Autodesk.AutoCAD namespaces for C# and Sample code

1561 Views, 10 Replies
09-12-2012 07:33 AM

Hi,

I am new to .Net and trying to do some C# programming. Where can I find some Autocad sample code for download?. Also where can I get the following namespaces?.

Autodesk.AutoCAD.ApplicationServices;

 Autodesk.AutoCAD.DatabaseServices;

 Autodesk.AutoCAD.EditorInput;

 Autodesk.AutoCAD.Runtime;

 Autodesk.AutoCAD.Geometry;

 Autodesk.AutoCAD.GraphicsInterface

I shall be thankful for help.

AloyH

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 11 (1,553 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-12-2012 07:44 AM in reply to: AloyH

You might want to download this example:

http://download.autodesk.com/media/adn/AutoCADDotNet_06thSept12.zip

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Contributor
AloyH
Posts: 12
Registered: ‎09-12-2012
Message 3 of 11 (1,519 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-13-2012 05:13 AM in reply to: AloyH

Thanks Hallex

AloyH

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 4 of 11 (1,514 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-13-2012 05:41 AM in reply to: AloyH

No problem

Digg dipper inside the API

Cheers :smileyhappy:

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Contributor
AloyH
Posts: 12
Registered: ‎09-12-2012
Message 5 of 11 (1,475 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-15-2012 05:48 PM in reply to: AloyH

Hallex,

I am using AutoCAD 2011 and Visual Studio (pro) 2010. I down loaded ObjectARX 2010-2012 (for C#) and was trying to reference the three dlls namely: acdbmgd.dll, acmgd.dll and accoremgd.dll and ended up in an emplty folder each time. It appears what is contained in the SDK are only C++ classes. What seems to be the problem?.

Thanking in advance.

Aloyh 

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 6 of 11 (1,427 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-18-2012 01:25 AM in reply to: AloyH

I can't test this issue, because I still

working with A2010 only

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
*Expert Elite*
Alfred.NESWADBA
Posts: 9,608
Registered: ‎06-29-2007
Message 7 of 11 (1,425 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-18-2012 01:43 AM in reply to: AloyH

Hi,

 

>> trying to reference the three dlls namely: [...] accoremgd.dll

AcCoreMgd.DLL has to be used starting with 2013, not for 2012 and previous.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Contributor
AloyH
Posts: 12
Registered: ‎09-12-2012
Message 8 of 11 (1,399 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-18-2012 11:01 PM in reply to: AloyH

Hallex,

Thank you for replying. Can you access the C# namespaces I have indicated in my fisrt posting using visual studio 2010?. If so ,pl let me know how you did it. I downloaded the Sep 6 examples indicated in the link you gave me, but cannot use the samples. Perhaps these are applicable to A2013.

Regards,

AloyH

Contributor
AloyH
Posts: 12
Registered: ‎09-12-2012
Message 9 of 11 (1,398 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-18-2012 11:07 PM in reply to: Alfred.NESWADBA

Hi Alfred,

Thanks for your reply. As you might have observed I use A2011 and Visual Studio 2010. My problem is how to use them for .Net API and referencing those dlls and use the name spaces indicated for C#.

Regards,

AloyH

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 10 of 11 (1,367 Views)

Re: Autodesk.AutoCAD namespaces for C# and Sample code

09-21-2012 05:50 AM in reply to: AloyH

Hello,

 

If you are using Visual Studio 2010 and AutoCAD 2011, then you will need to set the .Net Framework version to 3.5 in the project settings. You can then reference the Acmgd.dll and acdbmgd.dll from the <ObjectARX 2011>\inc folder. As Alfred said, you will not have the accoremgd.dll in the ObjectARX 2011 folder.

 

Set the references as "CopyLocal" as False and you are all set.

 

I have attached a simple sample project that I created using VS 2010 and that works with AutoCAD 2011.

 

Hope this helps.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.