Autodesk.AutoCAD namespaces for C# and Sample code

Autodesk.AutoCAD namespaces for C# and Sample code

Anonymous
Not applicable
6,299 Views
10 Replies
Message 1 of 11

Autodesk.AutoCAD namespaces for C# and Sample code

Anonymous
Not applicable

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

0 Likes
6,300 Views
10 Replies
Replies (10)
Message 2 of 11

Hallex
Advisor
Advisor

You might want to download this example:

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

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 11

Anonymous
Not applicable

Thanks Hallex

AloyH

0 Likes
Message 4 of 11

Hallex
Advisor
Advisor

No problem

Digg dipper inside the API

Cheers Smiley Happy

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 5 of 11

Anonymous
Not applicable

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 

0 Likes
Message 6 of 11

Hallex
Advisor
Advisor

I can't test this issue, because I still

working with A2010 only

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 7 of 11

Alfred.NESWADBA
Consultant
Consultant

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
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 8 of 11

Anonymous
Not applicable

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

0 Likes
Message 9 of 11

Anonymous
Not applicable

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

0 Likes
Message 10 of 11

Balaji_Ram
Alumni
Alumni

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

0 Likes
Message 11 of 11

Anonymous
Not applicable

Thanks.

It works well with ACAD 2011.

I would like to copy and paste it in .Net forum in CadTutor where a similar posting by me remained unanswered for 10 days untill yours appeared.

Namasthei Balaji.

AloyH

 

0 Likes