Submitted by obe0009 on Tue, 12/03/2013 - 05:52
Forums:
Hello,
I used and modified a bit the journal which walks through an assembly.
I use this one for verifying which users made the parts.
I am a teacher at a engineering school.
I want to skip files which were created earlier (library elements).
My programming skills are limited. I can not find the code which
gets the created date from a part and compares with an set date
to skip the operation which give me the users.
If any one knows how to clear the Information window for each run
I would appreciate that.
Regards,
Olaf
File creation date, Clearing Listing Window
To get the file creation date, you can use a standard .NET function: System.IO.File.GetCreationTime( )
To clear the Info window you can use some combination of the NX/Open functions like UFSession.Ui.CloseListingWindow(), UFSession.Ui.ExitListingWindow(), UFSession.Ui.OpenListingWindow().
Alternatively, use the SNAP function Snap.InfoWindow.Clear(). If you are in an academic institution, you should have access to the SNAP API, which will be much easier if you are new to programming.
Walking through an Assembly
Walking through an assembly is much easier if you use SNAP functions, because then your code doesn't need to be recursive (usually). Newbie programmers often find recursive code very confusing, in my experience. There are several examples in the SNAP documentation (the Getting Started guide and the Refenece Manual).