Results 1 to 3 of 3

Thread: VB.Net Netload DLL and Windows forms (EXE)

  1. #1
    100 Club KevinBarnett's Avatar
    Join Date
    Pretoria, South Africa
    Login to Give a bone

    Question VB.Net Netload DLL and Windows forms (EXE)

    I know I know that title does not make sense. I need help, or even a gentle hint of the right direction.

    I successfully made a Class in VB.Net and compiled a DLL that loaded with AutoCAD's Netload command (references to acdbmgd.dll and acmgd.dll):

    Imports Autodesk.AutoCAD.ApplicationServices
    Imports Autodesk.AutoCAD.EditorInput
    Imports Autodesk.AutoCAD.Runtime
    Public Class Class1
    <CommandMethod("HelloWorld")> _
    Public Sub HelloWorld()
    Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
    ed.WriteMessage("Hello World")
    End Sub
    End Class

    In a seperate VB.Net project I used a Windows form to search our SQL database for standard drawings records - it compiles to an exe.

    Now I want to merge the two and make a DLL that can be loaded by Acad's netload, making a command that will display the windows form.

    I opened the project that includes the windows form and added a class similar to the one above except the command code inside the CommandMethod is:
    dim Frm as New Form1

    I just cant locate where to compile it to a DLL, so I can load it with Netload.

    It's ok I can take it, tell me just how many things I did wrong.


    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

  2. #2
    100 Club
    Join Date
    Adelaide, South Australia
    Login to Give a bone

    Default Re: VB.Net Netload DLL and Windows forms (EXE)

    In the Solution Explorer right click your project, select Properties then in the dialog change the Output type from Windows Application to Class Library.

    Regards - Nathan

  3. #3
    Woo! Hoo! my 1st post
    Join Date
    West Jordan, UT
    Login to Give a bone

    Default Re: VB.Net Netload DLL and Windows forms (EXE)

    According to Clayton Hotson and his class on .NET at AU, he said that when using forms you should be using the .ShowModalDialog() or .ShowModelessDialog() methods rather than .Show() which is not supported in Acad. Additional benefits of using the preferred methods include forms remembering sizing and positioning changes throughout the session.

    Ben Rand
    CAD Manager
    CEntry Constructors & Engineers

Similar Threads

  1. Replies: 9
    Last Post: 2017-10-16, 04:27 PM
  2. Netload Example
    By peter in forum Bridging the Gap: LISP -> .NET -> LISP
    Replies: 5
    Last Post: 2014-01-14, 09:26 PM
  3. AutoCAD Text Window disabled by Windows Forms
    By bernie.snodgrass892799 in forum Dot Net API
    Replies: 2
    Last Post: 2013-05-21, 09:09 PM
  4. Using Windows Forms vb
    By drewj in forum Revit - API
    Replies: 1
    Last Post: 2012-07-19, 08:43 PM
  5. Error on Netload (DLL on network)
    By Dubweisertm in forum Dot Net API
    Replies: 2
    Last Post: 2011-09-22, 09:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts