# NX 2412
# Journal created by antoi on Mon Nov 17 12:16:50 2025 Eastern Standard Time
#
import math
import NXOpen
def main(args) : 

    theSession  = NXOpen.Session.GetSession() #type: NXOpen.Session
    workPart = theSession.Parts.Work
    displayPart = theSession.Parts.Display
    # ----------------------------------------------
    #   Menu: Tools->Utilities->Expressions...
    # ----------------------------------------------
    markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
    
    theSession.SetUndoMarkName(markId1, "Expressions Dialog")
    
    markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Import Expressions")
    
    expModified1, errorMessages1 = workPart.Expressions.ImportFromFile("C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\nx_journals\\user_generated_journals\\study_variables_expressions_from_journal.exp", NXOpen.ExpressionCollection.ImportMode.Replace)
    
    markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
    
    theSession.DeleteUndoMark(markId3, None)
    
    markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
    
    markId5 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Make Up to Date")
    
    markId6 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "NX update")
    
    nErrs1 = theSession.UpdateManager.DoUpdate(markId6)
    
    theSession.DeleteUndoMark(markId6, "NX update")
    
    theSession.DeleteUndoMark(markId5, None)
    
    theSession.DeleteUndoMark(markId4, None)
    
    theSession.SetUndoMarkName(markId1, "Expressions")
    
    theSession.DeleteUndoMark(markId2, None)
    
    # ----------------------------------------------
    #   Menu: Tools->Automation->Journal->Stop Recording
    # ----------------------------------------------
    
if __name__ == '__main__':
    main(sys.argv[1:])