Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX 1973 - Journal - Determine Modification Date of Feature 1

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
0
16
CA
If I select object information (CTRL+I) on a body, the listing window will return the Date & part history version when that body was last modified.

e.g.:
Modified Version 29 Apr 2020 14:24 (by user userwhois) Version 55

I would like to capture that information in a journal. Is there a property accessible that I can retrieve?

Thanks,
Jeff
 
Replies continue below

Recommended for you

Maybe something like this:

Code:
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

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top