.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some very basic VB.NET questions.

3 REPLIES 3
Reply
Message 1 of 4
tcorey
305 Views, 3 Replies

Some very basic VB.NET questions.

I have purchased Visual Studio 2008, which has c++, c#, and VB language interfaces.

If I am using the VB language interface, is that automatically creating .NET dll's when I build my app?

I am starting my AutoCAD VB using the Autodesk training "AutoCAD 2010 Managed VB.NET Training.3.doc." The very first program is supposed to write a line of text to the command line, but I get an unhandled exception error: Error binding to target method.

Here is my code:

{color:#800080}Imports Autodesk.AutoCAD.ApplicationServices{color}

{color:#800080}Imports Autodesk.AutoCAD.EditorInput{color}

{color:#800080}Imports Autodesk.AutoCAD.Runtime{color}





{color:#800080}Public Class Class1{color}

{color:#800080}<CommandMethod("HelloWorld")> _{color}

{color:#800080}Public Function HelloWorld(){color}

{color:#800080}Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor{color}

{color:#800080}ed.WriteMessage("This is a test"){color}

{color:#800080}End Function{color}



{color:#800080}End Class

{color:#000000}Any ideas? I took this directly out of the document, so it seems that is should work.
{color}
{color:#000000}Also, I know this is a very basic question, but I am a rank beginner, so please bear with me: To create the .dll I need for use in AutoCAD, I only have to Build my application, right? And the correct .dll is the one in <vbproject>\bin\release, not the one in <vbproject>\obj\release? And I just have to use Netload to load the .dll and then type the new command name?

Thanks in advance!

Tim Corey


{color}
{color}



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
3 REPLIES 3
Message 2 of 4
arcticad
in reply to: tcorey

you will need to go into your "My Project" > Debug > Start Action and Add Start External Program:

C:\Program Files\AutoCAD 2010\acad.exe

Then when you run autocad you will need to type in netload
and select the dll file. Which is usually in the bin\debug folder of your project, Unless you made it a release.

You can't use a function in a CommandMethod.

Public Sub HelloWorld()

This is why you are getting an exception error.
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 3 of 4
tcorey
in reply to: tcorey

Thanks, Arcticad.


Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 4 of 4
arcticad
in reply to: tcorey

Your Welcome
---------------------------



(defun botsbuildbots() (botsbuildbots))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost