For Each tempBody As Body In theSession.Parts.Work.Bodies
'based on nx_api6071
'also see {part}.GetHistoryInformation()
Dim cre_version As Integer = 0,
gmtime As Integer = 0,
mod_version As Integer = 0,
num As Integer = 0,
version As Integer = 0
Dim program As String = ""
Dim machine As String = ""
Dim user As String = ""
Dim historyList As IntPtr = Nothing
Dim nDateTime As System.DateTime = New System.DateTime(1970, 1, 1, 0, 0, 0, 0)
Dim myDateTime As Date = Nothing
theUfSession.Part.CreateHistoryList(historyList)
theUfSession.Part.AskPartHistory(theSession.Parts.Work.Tag, historyList)
theUfSession.Part.AskNumHistories(historyList, num)
theUfSession.Obj.AskCreModVersions(tempBody.Tag, cre_version, mod_version)
theUfSession.Part.AskNthHistory(historyList, num - cre_version, program, user, machine, version, gmtime)
myDateTime = nDateTime.AddSeconds(gmtime)
lw.WriteLine("Creation version: " & cre_version & " " & program & " " & myDateTime.ToString & " " & user)
theUfSession.Part.AskNthHistory(historyList, num - mod_version, program, user, machine, version, gmtime)
myDateTime = nDateTime.AddSeconds(gmtime)
lw.WriteLine("Modified version: " & mod_version & " " & program & " " & myDateTime.ToString & " " & user)
theUfSession.Part.ClearHistoryList(historyList)
Next