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

How do I make an AutoCAD .Net application with forms?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
stevenelliott3894
5738 Views, 7 Replies

How do I make an AutoCAD .Net application with forms?

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.

 

Steven Elliott

When I was a little bitty boy, my grandmother bought me a cute little toy. Silver bells hangin' on a string... she told me it was my ding-a-ling-a-ling!
7 REPLIES 7
Message 2 of 8

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).

Message 3 of 8

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)

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 4 of 8

You have to add a reference to System.Windows.Forms.dll to use

Forms or controls in .NET projects.



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Message 5 of 8

Just adding that reference did not add the controls to the toolbox, as I mentioned in my first message.

Steven Elliott

When I was a little bitty boy, my grandmother bought me a cute little toy. Silver bells hangin' on a string... she told me it was my ding-a-ling-a-ling!
Message 6 of 8

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)

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 7 of 8

Steven, 

 

You keep mentioning toolbox but really in .Net the toolbox is where you can add CONTROLS to an existing object CLASS such as a form.

To add a form, you have to follow Michael's suggestion or you can also do to from the Project menu pulldown and select Add Windows Form.

 

HTH,

Josh Modglin
Advanced Technologies Solutions Logo
Message 8 of 8

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'.

Steven Elliott

When I was a little bitty boy, my grandmother bought me a cute little toy. Silver bells hangin' on a string... she told me it was my ding-a-ling-a-ling!

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