Loading/Lauching a macro from a toolbar button

Discussion in 'AutoCAD' started by Chris Shoemaker, Mar 28, 2005.

  1. I have a macro that i've been launching from a toolbar button. As of right
    now I have the project file loaded in the startup suite, and call the macro
    using something like this:

    ^C^C-VBARUN backgroundcleaner

    I would however like to create a toolbar button that provides a fully
    qualified path to the project/macro such that it can be loaded on demand
    without being in the startup suite. Using the -vbarun command and then
    copying in the whole thing on the command line works, but when i try to use
    the full path in the macro portion of the toolbutton like so:

    ^C^C-VBARUN "S:\PreProject
    Activity\ABS\Scripts\leaexpresstools.dvb!backgroundcleaner"

    it only gets as far as this:

    Command: -VBARUN
    Macro name: "S:
    Macro not found.

    Any ideas on how i could launch this macro from a toolbar button without
    first having the project loaded? Thanks in advance.

    -Chris
     
    Chris Shoemaker, Mar 28, 2005
    #1
  2. Chris Shoemaker

    juno Guest

    Try:

    ^c^c(defun c:runMe()(command "-vbarun""S:/PreProject
    Activity/ABS\Scripts/leaexpresstools.dvb!backgroundcleaner")(princ))
     
    juno, Mar 28, 2005
    #2
  3. Hi,

    A slightly better approach is to use (VL-VBARUN

    As Juno suggested you have to use forward slashes either way. Also put a
    semi-colon at the end to ensure a carriage return. Spaces are not obvious.

    ^c^c(defun c:runMe()(vl-vbarun "S:/PreProject
    Activity/ABS\Scripts/leaexpresstools.dvb!backgroundcleaner")(princ));

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Mar 28, 2005
    #3
  4. Excuse this, but I don't really follow what you're
    attempting to illustrate here.

    The menu macro you show, defines a command
    when the user clicks on the button/menu item
    that executes the macro. I fail to see the purpose.
     
    Tony Tanzillo, Mar 28, 2005
    #4
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.