Posts: 19
Registered: ‎03-18-2012
Message 1 of 4 (765 Views)

Autocad with C#

765 Views, 3 Replies
03-18-2012 09:49 AM



I'm a profession Autocad user and I get a help my friend who profession about C#.

I'm a begineer about AutoCad and programming. I succeed to commenation C# and autocad.  (like DevTv "Hello World")


I need a C# codes for Autocad 2012 programming.  I mean is that same codes Visual Basic for Application codes and C# codes? (like class)


Also I need a advice about this subject.


Thanks for helpings..

Valued Mentor
Posts: 376
Registered: ‎07-29-2008
Message 2 of 4 (763 Views)

Re: Autocad with C#

03-18-2012 10:00 AM in reply to: ozkan_0712

Have you downloaded the ObjectARX developer kit and looked at the samples? Also try the following links:




Posts: 19
Registered: ‎03-18-2012
Message 3 of 4 (757 Views)

Re: Autocad with C#

03-18-2012 10:26 AM in reply to: ozkan_0712



Thanks for helping.


Yes, We download objectarx Documentation and  Download Complete ObjectARX SDK.


We looked and studied about it. But I think our problem is that I and my friend work different area. I'm a designer. He is a programmer. 


We made some codes that use Visual Basic for application(in Autocad Tool box) and it worked.But we need to more detail about it.


For example:

SolidSelection.Select acSelectionSetAll


This code is the same use C sharp. ?



If TumPar.Count <> 0 Then
With TumPar
For xp = 1 To .Count
.Remove (1)
Next xp
End With
End If


On Error Resume Next
Set SolidSelection = ThisDrawing.SelectionSets.Add("SS01")
grpCode(0) = 0
dataVal(0) = "3DSOLID"
SolidSelection.Select acSelectionSetAll, , , grpCode, dataVal
N = SolidSelection.Count
MsgBox "countyourdrawing: " & N


Posts: 1,458
Registered: ‎04-09-2008
Message 4 of 4 (739 Views)

Re: Autocad with C#

03-18-2012 02:34 PM in reply to: ozkan_0712

Posted code is VBA-code. This link can help you to migrate to VB.NET:


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
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.