VB.Net to AutoCAD 2004/05

Discussion in 'AutoCAD' started by jmodglin, Jun 7, 2004.

  1. jmodglin

    jmodglin Guest

    I have a few questions about VB.Net.

    1. First, how would you go about creating an AutoCAD integrated VB.Net application? (Where the user would not know another application is running but that it would look like it was part of AutoCAD)

    2. I am developing on AutoCAD 2004 but am reading different statements about having native commands in 2005. Can anyone explain to a novice the whats / hows?

    3. General VB.Net question. Besides longer phrases what is the difference between

    Dim App as AutoCAD.Application
    Dim App as Application (With Import)

    Thanks for any input

    Josh
     
    jmodglin, Jun 7, 2004
    #1
  2. If 2005, you create a DLL and uses NETLOAD at startup to automatically load
    your program. Buttons, menus, whatever will call your app.
    In simplest terms, *you* need to create your own GAC for 2004 but it is
    provided for you in 2005. If you are going to dive in, go for 2005.
    To begin with the second one is NOT a valid early binding call to AutoCAD.
    It should be:

    Imports Autodesk.AutoCAD.Interop
    Shared m_AcadApp As AcadApplication

    Shared could also be Private, Public, etc. As you wrote it, it would be a
    late binding call.
     
    Mike Tuersley, Jun 8, 2004
    #2
  3. jmodglin

    jmodglin Guest

    First, Thanks for responding Mike. I was beginning to wonder.

    Okay, so I would have to create a DLL - I am running VB.Net 2003 only and am new (if you did not know that already). Um, How do I create a dll file? Is this possible in plain VB?

    As regards the calls, I was writing them from memory (thank goodness for the AutoComplete) and just messed up. During this learning period it is easier for me to read if I write it all out and wondered if there was a reason to Import.

    If you could help me with the DLL issue it would be appreciated.

    Josh
     
    jmodglin, Jun 8, 2004
    #3
  4. Whenever you select a new project, use the Class Library template
    Not sure you what you mean by plain VB? If the above doesn't answer your
    question, hit me with it again.
    No problem, I can understand
    Well Josh, you didn't pick an easy issue to start with. You'll need to read
    up on the Class modules. I have pretty much abandoned VB.NET for C# so I
    don't have any vb examples handy. If someone else doesn't post one by this
    evening, I'll bang out a very simple example for you

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jun 8, 2004
    #4
  5. It's good to know I'm not alone. What prompted your decision?
     
    Frank Oquendo, Jun 8, 2004
    #5
  6. I have pretty much abandoned VB.NET for C#
    Actually, it was a comment YOU made about having too many bad habits :)

    I was thrown into a large project that had to be .NET without having any
    kind of training other than an O'Reilly book I picked up. Needless to say,
    too many of my issues were caused by me fighting the new system. About that
    time I saw a post from you and simultaneously was having a dscussion with
    Bobby and it made me rethink my approach. I found that using a new language
    made me take my time, really read what I was writing and understand the
    concepts.

    Now I just wish someone would write a case-sensitive add-on for C# :) That
    is my bad habit that I'm having problems letting go of at this point.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jun 8, 2004
    #6
  7. jmodglin

    jmodglin Guest

    Thanks again for the help. The responses seem to make sense.
    I am a bit sidetracked now but will try your suggestions just as soon as I can and will keep you posted.

    Josh
     
    jmodglin, Jun 8, 2004
    #7
  8. It's a very clean and capable language. As Mike pointed out, it's also
    not VB which is quite handy since we have a tendency to migrate what we
    know. Only problem is that very little of what we know is useful in
    VB.NET.
     
    Frank Oquendo, Jun 8, 2004
    #8
  9. Hi Frank,

    I guess I can't name names, but we received a very strong indication from an
    AutoCAD staffer who knows about the API system that he uses C#.

    It's making me think that when I move to .Net that I'll probably make that
    jump too.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Jun 8, 2004
    #9
  10. jmodglin

    Ed Jobe Guest

    Only problem is that very little of what we know is useful in
    VB.NET.

    That's real nice!
     
    Ed Jobe, Jun 8, 2004
    #10
  11. jmodglin

    jmodglin Guest

    Okay Mike, (Frank and Laurie)

    I tried to start a new Class Library Template but that option does not exist for me.
    I do not have Visual Studio but only VB.Net (one member of VS). I am guessing this is not an option for me...?!

    Josh
     
    jmodglin, Jun 9, 2004
    #11
  12. No, it isn't. You can still compile DLLs, you just don't have a project
    template for them.
     
    Frank Oquendo, Jun 9, 2004
    #12
  13. jmodglin

    HJohn Guest

    I wonder why anyone with VB experience would just switch to C#, since both languages are build on top of the .NET framework providing the same capabilities with only syntax difference. If learning a new language is the compelling reason to switch, then go for it. Else, read more about it.
     
    HJohn, Jun 9, 2004
    #13
  14. There is more to it than just that. C# will be replacng ObjectARX and
    Autodesk is steering its developers to it.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jun 9, 2004
    #14
  15. jmodglin

    jmodglin Guest

    Frank, do you mind guiding me to where/how I can compile dlls from a project or...?

    It looks like from the sounds of things I will be attacking another new language in the coming months/years.
     
    jmodglin, Jun 9, 2004
    #15
  16. jmodglin

    HJohn Guest

    Mike, I think that Microsoft is moving into .NET to create an universal platform (the framework) that would allow applications run independently of machine or OS. Therefore, it won’t matter if AutoDesk chooses C# or any other language to develop their software in .NET. You still would be able to choose the language of your preference because for the framework they all have equal capabilities. If this is not the case, I would like to know the reason.
     
    HJohn, Jun 9, 2004
    #16
  17. The issue here is not C# vs. VB.NET. It's VB vs. VB.NET.

    I found my prior VB experience to be a hinderance when learning .NET as
    VB.NET went to great lengths to retain classic VB's feel. But other than
    the name, the two languages have very little in common.

    So rather than keep trying to port what I knew to a platform where that
    knowledge was no longer applicable, I switched to C#. That one move
    allowed me to concentrate on learning .NET rather than tryong to migrate
    to .NET.
     
    Frank Oquendo, Jun 9, 2004
    #17
  18. jmodglin

    HJohn Guest

    Frank, it is fine, if personal reasons are making someone choose one language over another. The point I was trying bring up is that there seem to be no advantage in either performance or capacity of one language over another. I have heard a few commentaries about the topic, where some people would say that one language is better that another one. I researched this topic, and came up with the conclusion that there was no clear advantage of any language. However, experienced VB programmer would find that VB .NET has many similarities with VB, after all the two are not completely different. So when I read …

    I have pretty much abandoned VB.NET for C#

    It's good to know I'm not alone. What prompted your decision?

    I guess I can't name names, but we received a very strong indication from an
    AutoCAD staffer who knows about the API system that he uses C#.

    I decided to start this discussion to see if more info would come out.
     
    HJohn, Jun 9, 2004
    #18
  19. Amen!

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jun 9, 2004
    #19
  20. That's supposedly true from Miicrosoft but this isn't nirvana...Autodesk
    has chosen C# therefore:

    1. All documentation is currently in C++ and will eventually be ported to
    C#. [Unless you are using VB.NET and referencing the COM libraries - whch
    isn't programming in .NET]

    2. All .NETers are being refered to the ObjectARX documentation/object
    model. How many VBer's can read/decipher C++ or can grasp that object
    model?

    3. Autodesk is quickly getting C# examples compiled on ADN because there is
    less of a curve going from C++ to C# then C++ to VB.NET. Ask any ADN member
    which request he gets quicker - a C# or a VB.NET sample.

    4. Most C++'ers respect C# and are jumping on board; most still see VB.NET
    as VB [same as vb6ers].

    So, eventually it could all work as you think [and MS preaches] assuming
    someone takes the time to either write a C# middleware to your VB.NET app
    or you learn to read C# so you can re-create it in VB.NET or translate the
    help file into VB.NET. In which case, the individual will find C# is
    easier, more efficient [a lot less typing], and they'll come over to the
    'dark side' much the same as lispers did with vb/a.

    I could be wrong, but that's the way I've been hearing it from a lot of
    Autodesk sources in a lot of different dev departments.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jun 9, 2004
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.