AutoCAD 2011 and AutoCAD-based verticals no longer ship with VBA (Microsoft’s Visual Basic for Applications). The 32– and 64-bit versions are still available as a download from www.autodesk.com/vba-download. VBA will not be supported by AutoCAD 2012. The VBA module will no longer be available as a download then.
We can point ti Microsoft as the reason for this change. They discontinued the sale of new VBA distribution licenses back in 2007 and they are not planning any further development. This leaves software companies and customers in a bind. Microsoft has promoted the use of VBA as a “universal” programming language only to abandoned it.
This means that programmers need to stop writing new VBA code now and eventually port their VBA code to other APIs. Autodesk was unsure which of Microsoft’s APIs might be the most future-proof one:
“We are still at an early stage in evaluating what (if any) in-product IDE should replace VBA. However, at this time, we do not expect to be embedding VSTA into Autodesk products. Revit software is currently the only Autodesk product that incorporates VSTA. However, our review of in-product IDEs will include an evaluation of whether VSTA is the best long-term IDE solution for Revit. Therefore, we encourage Revit add-in developers to concentrate on creating professional add-ins using Visual Studio rather than VSTA when possible.”
The elimination of VBA does not affect AutoCAD’s ActiveX COM (common object model), which was also designed by Microsoft originally.
For now, Autodesk’s recommends moving your VBA code to a .net language, such as VB.NET using Visual Studio 2008, including the free Express edition available from www.msdn.microsoft.com/enus/vstudio/aa718373.aspx.
Autodesk provides the following resources for migrating VBA code to .net, and plans more in the future:
• AutoCAD VBA to VB.NET Migration Basics – on using .net COM Interop to simplify migration
• AutoCAD .NET Developers Guide – contains many comparative samples of native .NET API and the VBA code required to perform the same task (docs.autodesk.com/ACD/ 2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html>.
TIll next time