Running macro @ startup with multiple modules

Discussion in 'SolidWorks' started by Corey Scheich, Feb 19, 2004.

  1. Dale Dunn graciously provided me with a tip to start a macro upon startup of
    SW by adding this to the shortcut target
    "C:\Program Files\SolidWorks\SLDWORKS.exe" /m "G:\users\cds\Working
    Macros\Events.swp"

    The problem I have run into is I added a few Modules and now it is running
    the wrong function
    Instead of Module1.Main I am getting Get_User_Name.GetUserName, Is there a
    way to specify Module1.Main or to specify which function runs automatically,
    say, in the code or preferences or something

    TIA

    Corey Scheich
     
    Corey Scheich, Feb 19, 2004
    #1
  2. Corey Scheich

    rocheey Guest

    Is there a way to specify Module1.Main

    Im not sure if there is, but that would sure be handy


    Try moving your Sub Main to be the LAST sub/function in the module.
     
    rocheey, Feb 20, 2004
    #2
  3. Corey Scheich

    TheTick Guest

    One possibility...

    One quirk I found with SW macros is that the code for "Sub Main()"
    has to be at the bottom of the module it is in.
     
    TheTick, Feb 20, 2004
    #3
  4. Corey Scheich

    Gabe Osten Guest

    A shade off topic... Does anyone know if there are any other "undocumented"
    command line switches that could be usefull?
     
    Gabe Osten, Feb 20, 2004
    #4
  5. I am running 2003, and that worked but I had to move it to the module that
    was being run and move it to the bottom. How does it decide which module to
    look for Sub Main() in. I had it in Module1 and it was the only procedure
    in there. I haven't tested 2004.

    Corey
     
    Corey Scheich, Feb 20, 2004
    #5
  6. Please take a look at http://makeashorterlink.com/?Q4F622977

    HTH,
    Stefan

    --

    unofficial german SolidWorks helpsite
    http://solidworks.cad.de
    tools and programs for SolidWorks
    http://swtools.cad.de
     
    Stefan Berlitz, Feb 20, 2004
    #6
  7. Corey Scheich

    TheTick Guest

    Macros do have their limitations in size and ability. If you want to
    monitor events and start automatically with SW, there's nothing like
    an addin: smaller, faster, and cleaner, plus the ability to add
    toolbars and menus.

    I am putting together a presentation on making an addin from a VB .exe
    for our user group meeting (Milwaukee, WI, USA) March 4. This
    involves taking a simple VB .exe and adding one class module (well
    annotated with hints and explanations) plus a .res file for toolbar
    bitmaps (this will also be demystified). The project will be posted
    the following weekend to my website, http://www.EsoxRepublic.com

    Getting a full version of VB6 is well worth it. There are many
    advantages beyond just being able to compile. VB6 is fairly cheap,
    now that it is obsoleted by VB.net.

    p.s. I know I owe someone out there a posting of a registry scrub
    utility. It's done, I just have to get it posted. It should be up
    this weekend if the family stays healthy!
     
    TheTick, Feb 21, 2004
    #7
  8. Corey Scheich

    TheTick Guest

    FYI--

    My presentation has been preempted and rescheduled for the fall
    Chicago-area combined user group meeting.
     
    TheTick, Mar 3, 2004
    #8
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.