Forms in macros

Discussion in 'SolidWorks' started by TOP, Jul 20, 2005.

  1. TOP

    TOP Guest

    Is there a way to get forms to work in macros?
     
    TOP, Jul 20, 2005
    #1
  2. TOP

    Tony Guest

    Edit your macro and use the menu Insert-->UserForm. Add controls and adjust
    properties similar to VB. Then add code to extract data from the form and
    send it to SW.

    Good luck,

    Tony
     
    Tony, Jul 21, 2005
    #2
  3. TOP

    TOP Guest

    The problem wasn't creating the form, it was getting the form to work
    in a macro. The trick to this is to have a very simple main()
    subroutine.

    sub main()
    load userform1
    userform1.show
    end sub

    If you don't do this SW chokes when trying to load a form whithout a
    module that has main() in it. As you can see I figured it out. Thanks
    for your time.
     
    TOP, Jul 21, 2005
    #3
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.