AnsweredAssumed Answered

Event open document notify?

Question asked by Rodrigo Machado on Jul 17, 2014

What is the event function name that i have to write in the code bellow to notify me when a document opens in solidworks, any type of doc?

Please see my class code bellow.

 

it must be something like this, right?, what is the name in the place of "..."?

Private Function swapp_... As Long

    Call SetMyDoc

End Function

 

 

 

 

----Class code-------------

 

Option Explicit

    Private WithEvents swapp As SldWorks.SldWorks

    Private WithEvents pDoc As PartDoc

    Private WithEvents adoc As AssemblyDoc

   

    Private mDoc As ModelDoc2

   

    Private Enum swSummInfoField_e

            swSumInfoTitle = 0

            swSumInfoSubject = 1

            swSumInfoAuthor = 2

            swSumInfoKeywords = 3

            swSumInfoComment = 4

            swSumInfoSavedBy = 5

            swSumInfoCreateDate = 6

            swSumInfoSaveDate = 7

            swSumInfoCreateDate2 = 8

            swSumInfoSaveDate2 = 9

    End Enum

Private Sub Class_Initialize()

    Set swapp = Application.SldWorks

    SetMyDoc

End Sub

 

 

'------------------------------------------------------------------------

'Event Stuff >

Private Function aDoc_FileSaveAsNotify2(ByVal FileName As String) As Long

    aDoc_FileSaveAsNotify2 = CheckValid

End Function

Private Function aDoc_FileSaveNotify(ByVal FileName As String) As Long

    aDoc_FileSaveNotify = CheckValid

End Function

Private Function pDoc_FileSaveAsNotify2(ByVal FileName As String) As Long

    pDoc_FileSaveAsNotify2 = CheckValid

End Function

Private Function pDoc_FileSaveNotify(ByVal FileName As String) As Long

    pDoc_FileSaveNotify = CheckValid

End Function

Private Function swapp_ActiveDocChangeNotify() As Long

    Call SetMyDoc

End Function

 

 

Public Function swapp_OpenPostNotify(ByVal NewAddedDisplayStateName As String, SelectedComponentNames As Variant) As Long

    MsgBox "open"

End Function

Outcomes