-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClassModule.vb
More file actions
75 lines (38 loc) · 1.65 KB
/
ClassModule.vb
File metadata and controls
75 lines (38 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
'Class module:
'Option Explicit
'Public WithEvents SeFrameEvent As SolidEdgeFramework.ApplicationEvents 'Declare the public events watcher
'Private pSeCommandComplete As Boolean
'Private Sub Class_Initialize()
' Set SeFrameEvent = GetObject(, "SolidEdge.Application") 'Set the event handler to actual open SolidEdge session
' pSeCommandComplete = False 'Set the command complete boolean to false (Be sure to wait for command to be run)
'End Sub
''When we set the function to nothing
'Private Sub Class_Terminate()
' Set SeFrameEvent = Nothing
'End Sub
'Private Sub SeFrameEvent_AfterCommandRun(ByVal AssemblyAssemblyToolsShowAll As Long)
' pSeCommandComplete = True 'Be sure to exit the loop that is waiting for the command to be done.
'End Sub
''Send the value of the private bool
'Property Get SeCommandComplete() As Boolean
' SeCommandComplete = pSeCommandComplete
'End Property
''Set the value of the private bool
'Property Let SeCommandComplete(Value As Boolean)
' pSeCommandComplete = Value
'End Property
'Sub:
''Function to process a command and wait for it to be completed
'Function Fct_SeProcessCommand(CommandID As String, objSEFrame As SolidEdgeFramework.Application) As Boolean
' Dim SeEventListener As SeEvents
' Fct_SeProcessCommand = False 'Function failed
' On Error Resume Next
' Set SeEventListener = New SeEvents 'Set the event listener to know when command is over
' Call objSEFrame.StartCommand(CommandID)
' 'Loop until the command is done
' SeEventListener.SeCommandComplete = False
' Do While SeEventListener.SeCommandComplete = False
' DoEvents
' Loop
' Fct_SeProcessCommand = True 'Function succeed
'End Function