API Question : Status Bar when a document is being saved

Discussion in 'SolidWorks' started by SW Monkey, Mar 22, 2007.

  1. SW Monkey

    SW Monkey Guest

    I have a macro that saves PDF files to a specified user directory.
    When you save a PDF file in SolidWorks, it sometimes takes 2-3
    seconds. The screen may turn white where a message box was, and it
    looks like nothing is happening. Is it possible to display a message
    box stating "PDF is being saved", then remove the message box when the
    save operation is complete?

    Here is my code to save the PDF

    Save:
    bRet = swDrawing.SaveAs4(FileSave, swSaveAsCurrentVersion,
    swSaveAsOptions_Silent, swReadOnlySaveError, nWarnings)
    If bRet = False Then
    GoTo ErrorMsg
    End If
     
    SW Monkey, Mar 22, 2007
    #1
  2. SW Monkey

    fcsuper Guest

    SW Monkey,

    There isn't any message boxes for any other types of saves. Why is
    one needed for PDF?

    To answer the question, you use a form in your macro and have it
    display whatever messages you want.

    Matt
    http://sw.fcsuper.com
     
    fcsuper, Mar 23, 2007
    #2
  3. SW Monkey

    SW Monkey Guest

    fcsuper,

    I tried using a form. ( formname.show ) , but when the form pops up,
    the rest of the macro doesn't run unless I close the form.

    This is what I would like.
    MACRO CODE
    FORM POPUP
    CONTINUE MACRO CODE
    FORM CLOSES
    MACRO CODE ENDS
     
    SW Monkey, Mar 23, 2007
    #3
  4. SW Monkey

    fcsuper Guest

    SW Monkey,

    Perhaps this configuration?:
    MACRO CODE
    FORM POPUP
    FORM HAS FUNCTIONS ASSIGNED TO COMMAND BUTTONS WHICH PREFORM THE
    DESIRED TASKS
    FORM IS CLOSED AT USER'S CONVENIENCE
    MACRO CODE CLEANS HOUSE AND ENDS

    Under the SAVE command button you can have a preliminary change to a
    label that says "Saving to PDF", then have the save code, then an
    error handler that will display the results to the label once the save
    is complete (with some IF THEN's that use the error variables you've
    used in the save code). Mind you, this is all for show since the VBA
    isn't directly talking to any PDF status report, but it shows a status
    that which you require.

    Matt
    http://sw.fcsuper.com
     
    fcsuper, Mar 24, 2007
    #4
  5. SW Monkey

    Heikki Leivo Guest

    Re: API Question : Status Bar when a document is being saved

    *ahem...* Have you ever looked at the mighty SolidWorks API help?

    Hint: You could, for example, search for status bar.
    Another hint: you could write your status text to the status bar and clear
    the text when you are finished. No need to hassle with clumsy message boxes.

    -h-
     
    Heikki Leivo, Mar 25, 2007
    #5
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.