HelloWorld program.

HelloWorld program.

Anonymous
Not applicable
377 Views
1 Reply
Message 1 of 2

HelloWorld program.

Anonymous
Not applicable
I have selected Autodesk.AutoCAD.Interop.common as my GAC reference. Why won't this program compile????

'
' Created by SharpDevelop.
' User: ESepich
' Date: 8/10/2005
' Time: 12:20 PM
'
' To change this template use Tools | Options | Coding | Edit Standard Headers.
'
Imports System
Imports System.Runtime.InteropServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices

Imports acadApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class HelloWorld
_
Public Sub HelloCommand()
acadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage( _
vbNewLine & "Hello World!" & vbNewLine)
acadApp.UpdateScreen()
End Sub

End ClassM

ERRORS:
------ Build started: Project: HelloWorld Configuration: Debug ------
Performing main compilation...


C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(11) : error BC30466: Namespace or type 'Runtime' for the Imports 'Autodesk.AutoCAD.Runtime' cannot be found.

Imports Autodesk.AutoCAD.Runtime
~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(12) : error BC30466: Namespace or type 'ApplicationServices' for the Imports 'Autodesk.AutoCAD.ApplicationServices' cannot be found.

Imports Autodesk.AutoCAD.ApplicationServices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(14) : error BC30466: Namespace or type 'Application' for the Imports 'Autodesk.AutoCAD.ApplicationServices.Application' cannot be found.

Imports acadApp = Autodesk.AutoCAD.ApplicationServices.Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(16) : error BC30481: 'Class' statement must end with a matching 'End Class'.

Public Class HelloWorld
~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(19) : error BC30451: Name 'acadApp' is not declared.

acadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage( _
~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(20) : error BC30451: Name 'vbNewLine' is not declared.

vbNewLine & "Hello World!" & vbNewLine)
~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(20) : error BC30451: Name 'vbNewLine' is not declared.

vbNewLine & "Hello World!" & vbNewLine)
~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(21) : error BC30451: Name 'acadApp' is not declared.

acadApp.UpdateScreen()
~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(24) : error BC30678: 'End' statement not valid.

End ClassM
~~~

Build complete -- 9 errors, 0 warnings
0 Likes
378 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Your "HelloWorld" project uses ObjectARX managed (.NET) API, which is not
installed in GAC. You do no set reference to AutoCAD.Interop dll, which is
for Acad automation.

You need to set reference in your ObjectARX .NET API project to
"Drive:\Acad2005[2006]_installation_folder\acdbmgd.dll" and
"Drive:\Acad2005[2006]_installation_folder\acmgd.dll".

By the way, you'd better to post ObjectARX managed API related message to
"autodesk.autocad.customization.dotnet" group, instead of in VBA group


wrote in message news:4925305@discussion.autodesk.com...
I have selected Autodesk.AutoCAD.Interop.common as my GAC reference. Why
won't this program compile????

'
' Created by SharpDevelop.
' User: ESepich
' Date: 8/10/2005
' Time: 12:20 PM
'
' To change this template use Tools | Options | Coding | Edit Standard
Headers.
'
Imports System
Imports System.Runtime.InteropServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices

Imports acadApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class HelloWorld
_
Public Sub HelloCommand()
acadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage( _
vbNewLine & "Hello World!" & vbNewLine)
acadApp.UpdateScreen()
End Sub

End ClassM

ERRORS:
------ Build started: Project: HelloWorld Configuration: Debug ------
Performing main compilation...


C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(11) :
error BC30466: Namespace or type 'Runtime' for the Imports
'Autodesk.AutoCAD.Runtime' cannot be found.

Imports Autodesk.AutoCAD.Runtime
~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(12) :
error BC30466: Namespace or type 'ApplicationServices' for the Imports
'Autodesk.AutoCAD.ApplicationServices' cannot be found.

Imports Autodesk.AutoCAD.ApplicationServices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(14) :
error BC30466: Namespace or type 'Application' for the Imports
'Autodesk.AutoCAD.ApplicationServices.Application' cannot be found.

Imports acadApp = Autodesk.AutoCAD.ApplicationServices.Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(16) :
error BC30481: 'Class' statement must end with a matching 'End Class'.

Public Class HelloWorld
~~~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(19) :
error BC30451: Name 'acadApp' is not declared.

acadApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage( _
~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(20) :
error BC30451: Name 'vbNewLine' is not declared.

vbNewLine & "Hello World!" & vbNewLine)
~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(20) :
error BC30451: Name 'vbNewLine' is not declared.

vbNewLine & "Hello World!" & vbNewLine)
~~~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(21) :
error BC30451: Name 'acadApp' is not declared.

acadApp.UpdateScreen()
~~~~~~~
C:\Documents and Settings\ESepich\Desktop\HelloWorld\HelloWorld.vb(24) :
error BC30678: 'End' statement not valid.

End ClassM
~~~

Build complete -- 9 errors, 0 warnings
0 Likes