Posts: 216
Registered: ‎08-24-2010
Message 1 of 4 (216 Views)

First .net Program

216 Views, 3 Replies
02-25-2013 06:13 AM

Hi all


i donwload  ObjectARX 2011


and load ocx and dll to .net (VS2012)


and i created the class project and wite in it


'Contains the AutoCAD Type Library
Imports Autodesk.AutoCAD.Interop
'Contain the AutoCAD/ObjectDBX Type Library
Imports Autodesk.AutoCAD.Interop.Common

Public Class AdskCommand
    Public ReadOnly Property ThisDawing As AcadDocument
            Return Autodesk.AutoCAD. _
                ApplicationServices.Application. _
                DocumentManager.MdiActiveDocument. _
        End Get
    End Property

    <Autodesk.AutoCAD.Runtime.CommandMethod("myroutine")> _
    Public Sub myRoutine()
        ThisDawing.Utility.Prompt("Hello World From .Net")
    End Sub
End Class

 and no problem with compiling or save file in vs2012


 and i loaded it in CAD2010 or CAD 2013 using netload command


and when i write myRoutine in command bar . not run .. why



Active Contributor
Posts: 46
Registered: ‎09-04-2012
Message 2 of 4 (192 Views)

Re: First .net Program

02-25-2013 08:52 AM in reply to: Amremad

Try using .net Frameworks 4.0 and 3.5.

*Expert Elite*
Posts: 1,285
Registered: ‎06-21-2004
Message 3 of 4 (176 Views)

Re: First .net Program

02-25-2013 11:42 AM in reply to: DouceDeux

You don't need to install the ObjectARX files for your project if your programming c# or VB
ObjectARX is for c++ Programming.

You also don't need to use COM Autocad.interop and you should start with a .NET API solution.





for more information


(defun botsbuildbots() (botsbuildbots))
Valued Mentor
Posts: 477
Registered: ‎04-11-2010
Message 4 of 4 (153 Views)

Re: First .net Program

02-25-2013 05:47 PM in reply to: Amremad



You need to change the references and recompile for each version 2012/2013, as AutoCAD 2013 has changes in the API (some things were moved from one dll to another, and other changes)  also, 2013, added a new dll to reference in the project (AcCoreMgd.dll).


Gaston Nunez



Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.