I'm dipping my toe in the Revit API waters, AND learning VB.NET (using Visual Studio 200 at the same time, and would appreciate a little help. Here's what I\ve done:
1. In VS2008, I created a new class library. I *do* see that it's ".NET Framework 3.5"--does this make a difference?
2. In my new class ("PatricksClass"), I added a reference to "C:\Program Files\Revit Structure 2008\Program\RevitAPI.dll".
3. Here's my code:
Public Class PatricksClass
Implements Autodesk.Revit.IExternalCommand
Public Function Execute(ByVal commandData As Autodesk.Revit.ExternalCommandData, _
ByRef message As String, _
ByVal elements As Autodesk.Revit.ElementSet) _
As Autodesk.Revit.IExternalCommand.Result _
Implements Autodesk.Revit.IExternalCommand.Execute
MsgBox("Hello World")
Return Autodesk.Revit.IExternalCommand.Result.Succeeded
End Function
End Class
(This is correctly indented in my program, but doesn't appear so here in the forum)
4. In VS2008, I built the program.
5. I edited "C:\Program Files\Revit Structure 2008\Program\Revit.ini" and added the following:
[ExternalCommands]
ECCount= 1
ECName1= "Program01"
ECClassName1=RevitProgram01.PatricksClass
ECAssembly1=C:\Documents and Settings\pap\My Documents\Visual Studio 2008\Projects\RevitProgram01\RevitProgram01\bin\Release\RevitProgram01.dll
ECDescription1="Displays a Greeting"
(There are no line breaks in the ECAssembly1 line)
6. I started Revit, and my command showed up in the "Tools\External Tools" menu. It's the only one in there. So, I clicked on it, and...nothing happens.
Most of this is directly out of the AU2007 "ABCs of Programming in Revit" handout. TIA for any help in pointing out my error(s).