Results 1 to 5 of 5

Thread: Running VB procedures from AutoCAD menu

  1. #1
    Member
    Join Date
    2009-05
    Posts
    10
    Login to Give a bone
    0

    Default Running VB procedures from AutoCAD menu

    Hi, Im using AutoCAD 2004.

    I am trying to code a standalone Visual Basic 6 app for mainly inserting predefined blocks (for now) in an autocad drawing.

    I have a problem:

    How can I run a VB procedure from an autocad menu? Im hoping I can keep all my procedures in a dll file. Its easy to do it using VBA, using -vbarun module.macro , but is it possible to do it from VB? I dont want to use VBA, mainly because I cannot hide the code, and also because I need to bundle the application and distribute it with many other libraries which would not be available on many of the host computers.

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Running VB procedures from AutoCAD menu

    You may, indeed, create an ActiveX DLL. However, you will still need a stub of VBA code that is going to create an object supported by that DLL and utilize its exposed procedures. That VBA stub is the macro you need to excute in the menu.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Member
    Join Date
    2009-05
    Posts
    10
    Login to Give a bone
    0

    Default Re: Running VB procedures from AutoCAD menu

    hi,yes for now im doin it using a VBA code stub. Was unsure whether there was a way to run code in a dll directly from the menu. Nowatleast Im sure there is no way. Thanks

    I guess the fact that in VB.net I can write custom commands means that I can run those commands from the menu right?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Running VB procedures from AutoCAD menu

    Quote Originally Posted by Cap'nClown View Post
    I guess the fact that in VB.net I can write custom commands means that I can run those commands from the menu right?
    Correct.

    In fact, any new development should be in the .NET languages unless you are supporting old versions (which I know you are, and why I didn't bring this up earlier.)
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    Member
    Join Date
    2009-05
    Posts
    10
    Login to Give a bone
    0

    Default Re: Running VB procedures from AutoCAD menu

    okay. yeah i wanted to start with VB.net too...its just that there are a majority of ppl who are still using the older versions. and i have to build on them

Similar Threads

  1. Running Revit as AutoCAD?
    By Jordan Truesdell in forum Revit Structure - General
    Replies: 3
    Last Post: 2011-05-10, 05:41 PM
  2. Running AutoCAD on a Mac
    By Mlabell in forum Hardware
    Replies: 9
    Last Post: 2008-11-13, 02:44 AM
  3. How to write new menu file or update the existing menu in AutoCAD 2006
    By Partha Ghosh in forum CAD Management - General
    Replies: 1
    Last Post: 2007-09-30, 01:45 PM
  4. Running AutoCAD across a WAN
    By david.edwards in forum Networks
    Replies: 1
    Last Post: 2006-06-22, 11:57 AM
  5. Problems with running menu macro.
    By mikeevans in forum AutoCAD Customization
    Replies: 4
    Last Post: 2004-12-21, 02:02 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
  •