×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

can journaling force save open files

can journaling force save open files

can journaling force save open files

(OP)
NX 8.0.3.4
Windows 7 Service Pack 1
NAS file system across fiber optics

I'm having an issue with our file servers that our IT department is unable to solve. The problem is that modified files are being reported "saved" in NX, but on re-opening them not all files are saved in their latest state. As an example an assembly file was re-opened after the save-all, and components were missing. The component was on the file system, and had all the geometry including wave-linked geometry, which was created in the assembly. Another file in the same assembly which was modified after the missing part was created, was in a state previous to the creation of the missing component.

Another instance was in creating a stand-alone file, NX reported the save successful, but it didn't show up in the file system. Repeted tries at saving using all the options and "refreshing" windows-explorer did not show the file on disk. Doing a "save-as" by just removing the ".prt" frome the file name saved the part and showed it on disk.

Supposedly disk caching, and a routine that "compares" files and maximized disk usage has been turned off, so our IT department is at the end of what it knows to do.

My question, after all that, is there a way, through journaling perhaps, to "force save" all open parts?

RE: can journaling force save open files

A journal just gives you programmatic access to functions in NX. The "save" function in a journal doesn't do anything special that the interactive toolbar button or menu pick doesn't do. At best, you might be able to write some code that checks to make sure the part files exist on disk after performing a save, but this is only a band-aid - not a real solution.

Perhaps your IT coworkers might make more headway if you introduce them to www.tek-tips.com (eng-tips' sister site for IT topics).

www.nxjournaling.com

RE: can journaling force save open files

(OP)
Thanks cowski, that's what I thought. Is there any way to force a modified flag on all open parts then step through and save each one? Your answer on the tips site makes the most sense to me, wish it were that easy.

RE: can journaling force save open files

Here's a quick journal I put together that will report the status of all the parts in session (does it exist on disk and if so, list the last save timestamp), attempt to save all the modified parts, and report the new status of the parts.

CODE

Option Strict Off
Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        For Each tempPart As Part In theSession.Parts
            lw.WriteLine("before save")
            lw.WriteLine(tempPart.FullPath)
            lw.WriteLine("file exists on disk: " & IO.File.Exists(tempPart.FullPath).ToString)
            If IO.File.Exists(tempPart.FullPath) Then
                Dim infoReader As System.IO.FileInfo
                infoReader = My.Computer.FileSystem.GetFileInfo(tempPart.FullPath)
                lw.WriteLine("File was last modified on " & infoReader.LastWriteTime)

            End If

            lw.WriteLine("")
        Next

        theSession.Parts.ForceSaveAll()

        For Each tempPart As Part In theSession.Parts
            lw.WriteLine("after save")
            lw.WriteLine(tempPart.FullPath)
            lw.WriteLine("file exists on disk: " & IO.File.Exists(tempPart.FullPath).ToString)
            If IO.File.Exists(tempPart.FullPath) Then
                Dim infoReader As System.IO.FileInfo
                infoReader = My.Computer.FileSystem.GetFileInfo(tempPart.FullPath)
                lw.WriteLine("File was last modified on " & infoReader.LastWriteTime)

            End If

            lw.WriteLine("")
        Next

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

    End Function

End Module 

www.nxjournaling.com

RE: can journaling force save open files

(OP)
Just got in from a long weekend this morning and tried it.....thanks for your help. Will have to study your journal and learn, I like the way you code. All automation and programming here is self taught so this program is a great resource for me. Thanks again.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources