Call a macro from another macro?

Discussion in 'SolidWorks' started by What-a-Tool, Oct 13, 2004.

  1. What-a-Tool

    What-a-Tool Guest

    Is it possible?


    --

    / Sean the Mc /


    "I have not failed. I've just found 10,000 ways that won't work."
    - Thomas Alva Edison (1847-1931)
     
    What-a-Tool, Oct 13, 2004
    #1
  2. You can shell to it if it is an executable, but the only other way I know to
    do that is via a macro feature.
     
    Evan T. Basalik, Oct 13, 2004
    #2
  3. What-a-Tool

    bagarnx Guest

    Try this one:

    SldWorks.RunMacro "<path\macro-name>", "<ModuleName>", "<ProcedureName>"


    Search SolidWorks API Help for:
    'SldWorks::RunMacro'

    /Anders
     
    bagarnx, Oct 13, 2004
    #3
  4. What-a-Tool

    What-a-Tool Guest

    Thanx - Looks like just what I need!

    --

    / Sean the Mc /


    "I have not failed. I've just found 10,000 ways that won't work."
    - Thomas Alva Edison (1847-1931)
     
    What-a-Tool, Oct 13, 2004
    #4
  5. What-a-Tool

    That70sTick Guest

    from API help:
    retval = SldWorks.RunMacro ( filePathName, moduleName, procedureName )

    I've tried this, but I don't like it. The few attempts I've made,
    there were problems with forms and class modules not initializing
    properly.
     
    That70sTick, Oct 14, 2004
    #5
  6. What-a-Tool

    What-a-Tool Guest

    Tried it calling a macro with 5 modules and 3 forms - seemed to work great.
    This is just what I wanted to consolidate a few macro's I have with one
    interface to call any of them, without having to heap any more code into a
    single macro.

    --

    / Sean the Mc /


    "I have not failed. I've just found 10,000 ways that won't work."
    - Thomas Alva Edison (1847-1931)
     
    What-a-Tool, Oct 16, 2004
    #6
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.