Real and Dummy update of prt file

Hi all,

This is my first post, so excuse me if I don't describe my problem very well.

When you save a file from within NX, the system writes a new binary file even if nothing has been changed in the session (open .prt file and immediately press ctrl+s).
When you diff the two versions of the file(before opening and after saving), it is not obvious what has changed, but the difference is quite sufficient.
The .prt file appears to be an OLE object (Microsoft standard), which is a kind of archive. When I unpack a .prt file, it contains a few files (Microsoft call those Steams) located in few directories (they call them Storages).

For test purposes I unpacked 3 versions of a simple assembly:
1. Initial version - has a few parts in it with their placements and relations.
2. A fake update - open and immediately save the file.
3. A simple real update - open, edit a constrain between two of the parts and then save it.
Then I diffed the 3 folders containing the unpacked content and there is absolutely nothing to hint me on which one is which, if I don't know.

Now the actual question: Is there a marker, or some property of the session object, that can hint me as to whether any real (other than datetime) change has been made to a .prt file in the time between opening and saving it?
It doesn't really matter if it is something in the saved .prt file, or an object property, that does not get saved by default.

Thank you in advance :)

Best Regards,
lookcho

I've never had a need to dig into the underlying NX file structure. Therefore, I do not have a direct answer to your question; but if you open the file and go to: menu -> information -> part -> modifications, the information window will tell you if the part was saved with no significant changes (scroll to the bottom). So, NX knows if there was a significant change or not; there must be a way to do the same (either through the API or through examining the file structure).

I am interested in code to examine the NX file structure, if you are willing to share, please email it to: info@nxjournaling.com

Thanks!

Thank you for the reply.
Either that list only contains the times at which the file has been saved, or I am not able to filter the results by significance or type of the changes.

Can you give me a hint?

I will try and define the problem a bit better.
Consider, that you have two users working on the same project. One is supposed to work on certain subset of the part(s) and the other is supposed to work on the assembly and another subset of the parts.
Both open the assembly and both save it, but only one of them has actually edited it. Then they have to merge their work.
There must be a way to decide which one of them has actually changed the content of the assembly and which hasn't.
I don't need a way to merge the assemblies if both have been changed - just to figure when one of them only has a date changed (added to the list).

Whenever I have code for it, I will share it.

Ok, I figured how to use the function properly. It will do the job, if I figure what part of the API that uses.

Thank you a lot and I will tell you when I have something. :)

You asked about something that does the job and I since I finally figured how to use the API, I will share some code, though it is not much.

I know this forum is mostly about VB, but I am a Python programmer, so my code is in Python.

First important thing, that I have to mention is, that the official documentation is very sparse or non-existent, so it took some time to figure how to actually instantiate the module classes, in order to make them work as expected.
The following bit of code uses one of the NXOpen.UF.Part. methods, but in a similar manner it can be applied to any of them:


import NXOpen, NXOpen.UF

def get_last_modified_version(uf_session, part, show=False):
part_tag = part.Tag
last_modified = uf_session.Part.AskLastModifiedVersion(part_tag)
if show:
theUI = NXOpen.UI.GetUI()
theMessageBox.Show("help me",
NXOpen.NXMessageBox.DialogType.Information,
''.join([str(part), ' Part.Tag: ', str(part_tag),
' LMV: ', str(last_modified)]))
return last_modified

if __name__ == "__main__":
ses = NXOpen.Session.GetSession()
uf_ses = uf_session = NXOpen.UF.UFSession.GetUFSession()
display_part = ses.Parts.Display

get_last_modified_version(uf_ses, display_part, 1)