10-10-2013 08:03 PM
Hello,
I set up a tool for handling files in Insight environment.
Moving to various paths is no problem, but I have to fill out some user-defined attributes.
Therefore I use SolidEdgeFileProperties.PropertySets as the Revisionmanager.PropertySets doesnot work.
Now, the writing is no problem, but the releasing of the resources.
As long as my program is running, if I select few files (below 10) , the files are write-protected. If I end the program, the write-protection is deregulated immediately.
If I have selected a lot of files, only the last 5 to 10 files are write-protected (and the last 5 will keep the writeprotection as long as the program is running.
I have added the code below.
How can I free the files immediately without terminating the program.
By the way, I have the feeling, that the SolidEdgeFileProperties are not harmonized with Insight.
Try
objPropertySets = New SolidEdgeFileProperties.PropertySets
' Open a file
objPropertySets.Open(ASPFilename, False)
objProperties = objPropertySets.Item("Custom")
For j = 0 To objProperties.Count - 1
If objProperties.Item(j).Name = "N_Freigabedatum" Then
N_Freigabedatum_exists = True
End If
.......
Next
If N_Freigabedatum_exists Then
objProperties.Item("N_Freigabedatum").Value = m_Freigabedatum
Else
objProperties.Add("N_Freigabedatum", m_Freigabedatum)
End If
......
objPropertySets.Save()
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
If Not (objProperties Is Nothing) Then
Marshal.ReleaseComObject(objProperties)
objProperties = Nothing
End If
If Not (objPropertySets Is Nothing) Then
'Close underlying property storage
objPropertySets.Close()
Marshal.ReleaseComObject(objPropertySets)
objPropertySets = Nothing
End If
End Try
Posted by: Andreas Baumann
Post date: 12/28/2012 9:33:17 AM
10-10-2013 08:04 PM
Hello,
I found the answer for my problem in this article:
My problem was also of this IDLE-Issues and the GC.collect()-command solved my problem completely.
Posted by: Andreas Baumann
Post date: 12/29/2012 6:03:06 AM