I have a assembly,I want to judge all the occ referenced file state, opened or not?
Is there has a simple way to do it?
Solved! Go to Solution.
Solved by Stakin. Go to Solution.
Solved by Stakin. Go to Solution.
You may access all the in-memory documents through a collection InventorApplication.Documents.
Like:
Dim ofilename As string
ofilename = "C:\xxx\xxx.xxx"
Dim otdoc As Document
Dim t As Integer =0
For Each otdoc In ThisApplication.Documents
If otdoc.FullFileName=ofilename Then
t=t+1
End If
Next
If t>0 Then
MsgBox("The File had opened!")
Else
MsgBox("The File isn't opened yet!")
End If
it's great.
thank you very much!
Is there another way to do this work?
maybe like:
Dim odoc As Document
Dim ofilename As String
ofilename="C:\xx\xx.xxx"
Try
odoc=ThisApplication.Documents.ItemByName(ofilename)
MsgBox("The file had been opened ")
Catch
MsgBox("The file isn't opened yet!")
End Try
OR Is there has a efficient way to do this work??
The second version is OK.