Macro vbarun

Discussion in 'AutoCAD' started by CybercafeUser, Sep 15, 2003.

  1. I have the following Macro;

    *^C^C - vbarun "D:\users\vbatest.dvb!module1.function"

    This works but I want add parameters to the function.
    What kind of notation do I have to use?
     
    CybercafeUser, Sep 15, 2003
    #1
  2. CybercafeUser

    Ed Jobe Guest

    Correct, you cannot call a sub/function that has parameters as evidenced by the fact that they don't show up in the vbarun dialog. They also have to be declared as Public and not Private. Another trick In addition to what you mentioned is to open a form, set an object to it and then set some property on the form, then show the form. With the other methods, you can't directly pass an object, but you could pass its handle.




    --
    --
    Ed
    --



    "spanqy" <> wrote in message news:...

    Good question. Can you possibly include the prompting of parameter values as part of your macro. If not, I guess one key question is where are your parameter values stored?

    If they are stored in global AutoLISP varaiables, you can use the VLAX class (posted elsewhere) to get at these values from within your macro.

    I've also used the USERS1-5 system variables to temporarily store data I want passed in to my VBA project. I then use the ThisDrawing.GetVariable function to get at the values in VBA.

    Or you can write to the registry, which I do often, when the data I wish to store is more permanent in nature. Example: Remembering the last folder browsed to by the user.

    I know that these example may not be of the strict "between-the paranthesis" parameters you may be seeking, but they accomplish the same task - i.e. passing a value from ptA to ptB. I'm not sure that you can write:

    ^C^C - vbarun "D:\users\vbatest.dvb!module1.function(myParam1, myParam2)

    and get away with it - but I could be wrong. Anyone else agree/disagree?
     
    Ed Jobe, Sep 16, 2003
    #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.