Writing new extension

Discussion in 'AutoCAD' started by suresh_jakka, Nov 5, 2004.

  1. suresh_jakka

    suresh_jakka Guest

    Hi,

    I am new to AutoCAD customization. I am writing a new application on top of AutoCAD. My application has it's own menu that should plug-in to AutoCAD's main menu. My application commands interact with AutoCAD model and layout windows.

    Here are my questions, Could anyone of you answer them? Thanks a lot in advance

    1. Can we add menu items programmatically through a external VB application? I have seen examples in VBA to add menus to AutoCAD, but I didn't see any example adding menus to AutoCAD through a VB application.

    2. Can we compile VBA macros into a dll? I guess we cannot do it, but I am not sure.

    Could someone point me to some example applications/ sample code to learn more about the above things.

    Thanks a lot,
    Suresh
     
    suresh_jakka, Nov 5, 2004
    #1
  2. suresh_jakka

    Rudderdl Guest

    Here's an idea for an autoload of your VB stuff...

    First... if you do not already have an MNL file matching your main menu name create one...

    In the very end of this file insert a line like:
    (defun c:Welch ()(load "VBautoload.lsp")(c:Welch))
    ; where Welch is the command to launch the VB and (it can me anything you want)
    ; VBautoload.lsp is another file where - - - see below

    Create a VBautoload.lsp in the support directory and insert a line like...
    (command "_VBAload" "g:\path\morepath\visualbasicfile.dvb")
    (defun c:Welch ()(command "-vbarun" "DataConnect"))
    ; Where dataconnect is your macro name

    If you want the macro to automatically run on startup & what not - place a line in your ACAD.lsp file like
    (c:welch)
    ; where welch is your command to execute all this madness

    DLL may be possible but not worth the hassle...
     
    Rudderdl, Nov 17, 2004
    #2
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.