1 |
< |
Imports SldWorks |
2 |
< |
Imports SWPublished |
3 |
< |
Imports SwConst |
1 |
> |
Imports SolidWorks.Interop |
2 |
> |
Imports SolidWorks.Interop.swconst |
3 |
> |
Imports SolidWorks.Interop.swpublished |
4 |
|
Imports System.Runtime.InteropServices |
5 |
|
|
6 |
|
|
206 |
|
AttachSWEvents() |
207 |
|
|
208 |
|
'Listen for events on all currently open docs |
209 |
< |
Dim modDoc As ModelDoc2 |
209 |
> |
Dim modDoc As sldworks.ModelDoc2 |
210 |
|
modDoc = iSwApp.GetFirstDocument() |
211 |
|
While (Not modDoc Is Nothing) |
212 |
|
If (Not openDocs.Contains(modDoc)) Then |
221 |
|
|
222 |
|
'Close events on all currently open docs |
223 |
|
Dim docHandler As DocumentEventHandler |
224 |
< |
Dim key As ModelDoc2 |
224 |
> |
Dim key As sldworks.ModelDoc2 |
225 |
|
Dim numKeys As Integer |
226 |
|
numKeys = openDocs.Count |
227 |
|
If numKeys > 0 Then |
252 |
|
RemoveHandler iSwApp.ActiveModelDocChangeNotify, AddressOf Me.SldWorks_ActiveModelDocChangeNotify |
253 |
|
End Function |
254 |
|
|
255 |
< |
Function AttachModelDocEventHandler(ByVal modDoc As ModelDoc2) As Boolean |
255 |
> |
Function AttachModelDocEventHandler(ByVal modDoc As sldworks.ModelDoc2) As Boolean |
256 |
|
If modDoc Is Nothing Then |
257 |
|
Return False |
258 |
|
End If |
270 |
|
End If |
271 |
|
End Function |
272 |
|
|
273 |
< |
Function DetachModelEventHandler(ByVal modDoc As ModelDoc2) |
273 |
> |
Function DetachModelEventHandler(ByVal modDoc As sldworks.ModelDoc2) |
274 |
|
Dim docHandler As DocumentEventHandler |
275 |
|
docHandler = openDocs.Item(modDoc) |
276 |
|
openDocs.Remove(modDoc) |
285 |
|
End Function |
286 |
|
|
287 |
|
Function SldWorks_DocumentLoadNotify(ByVal docTitle As String, ByVal docPath As String) As Integer |
288 |
< |
Dim modDoc As ModelDoc2 |
288 |
> |
Dim modDoc As sldworks.ModelDoc2 |
289 |
|
modDoc = iSwApp.GetFirstDocument() |
290 |
|
While Not modDoc Is Nothing |
291 |
|
If modDoc.GetTitle = docTitle Then |