API, addins, FileSavePostNotify

Discussion in 'SolidWorks' started by Markku Lehtola, Aug 24, 2005.

  1. Hi,

    just exploring how to create addins with VB6 and can't figure out how to
    handle drawing events:

    Dim WithEvents swDrawing As SldWorks.DrawingDoc

    Private Function swDrawing_FileSavePostNotify(ByVal saveType As Long,
    ByVal FileName As String) As Long
    MsgBox "works"
    End Function


    this gives me nothing, no error, nothing. If I use FileOpenNotify it
    works...what's the trick with FileSavePostNotify?
     
    Markku Lehtola, Aug 24, 2005
    #1
  2. Markku Lehtola

    That70sTick Guest

    I've found the performance of "_FileSavePostNotify" to be spotty at
    times. It's almost as if it can plowed under by other activity. For
    example, if all files in an assembly are saving, sometimes the
    notification gets missed.

    I have a macro-to-API project that may interest you.
    <http://www.esoxrepublic.com/devtools/>
     
    That70sTick, Aug 24, 2005
    #2
  3. Markku Lehtola

    That70sTick Guest

    One more thing to check:

    When you invoke "WithEvents" to Dim an object, that object's events
    should be available in the drop-down list at the top of your code
    window. If the object and events aren't there, something isn't working
    right.

    Are other notifications working? Have you tried defining your
    SolidWorks application object using WithEvents, as well (i.e. "Dim
    WithEvents swApp as SldWorks.SldWorks")?
     
    That70sTick, Aug 24, 2005
    #3
  4. Got some help from SW Api-support:

    You have to use DocumentLoadNotify to reattach to event handlers, then it
    works. Code is the same when you attach to the document
     
    Markku Lehtola, Aug 24, 2005
    #4
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.