I need to recreate a VBA form application in .Net. I have all of AutoDesk's .Net stuff installed, including the ObjectArx SDK.
When I try to use the 'AutoCAD Managed VB Project Application Wizard' to start me off, there aren't any Windows Forms controls in the Toolbox to work with, and they don't appear if I merely add the same references a Windows Forms application has.
If I start off with VStudio's 'Windows Form Application' wizard, I get all the forms stuff, but won't this compile to an .exe instead of a dll? Which means I can't use netload to load it. What should I do here? AutoDesk's documentation doesn't seem to touch on creating forms apps... in fact, it seems pretty sparse on a lot of things.
I just can't believe AutoDesk is making us go this tortuous route to replace our VBA macros. This is a ridiculous amount of effort to make a freakin macro. What happened to VSTA???
I'm tempted to just load up VB6 and go the com route.
Solved! Go to Solution.
Solved by fieldguy. Go to Solution.
I have never used the wizards so I can't help there. But, if I create a class library, then right click on my class in solution explorer, select Add->Windows Form, designer opens and the "All Windows Forms" section of the tool box has everything in it (Visual Studio 2008).
You probably went through the same frustrations when learning VBA (I know I did!!)
You can go the COM route with .NET also, here's an AU session on VBA to .NET: http://au.autodesk.com/?nd=class&session_id=2999
Just remember that some of the verticals (like Civil3D) are no longer updating their COM interfaces.
If you can spend a little time learning .NET (either C# or VB), it to me, is really an easier language to deal with than VBA.
Example: want a File Browser Dialg? dim dlg as OpenFileDialog (none of the having to mess with finding code to call the Win API).
Your .NET apps will also be 32 & 64 bit compliant if you target "Any CPU" when you compile. (VBA is going away in ACad 2012)
You have to add a reference to System.Windows.Forms.dll to use
Forms or controls in .NET projects.
Just adding that reference did not add the controls to the toolbox, as I mentioned in my first message.
All you should need to do is right click on your project in Solution Explorer and choose Add>Windows Form. Give your form a name then add your controls to it. You can then call up the form within your command with something like below:
I've created a form using the above method call "formMain"
Dim form as formMain
form = New formMain
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelDialog(form)
Yes, thanks to all who have replied to try and help me. I got how to solve my problem from the first reply by fieldguy, which is why I have since marked this as 'Solved'.