I’ve been working on an in-house Performance benchmarking system and am now considering options to macro-fy some of the tasks.
I have been looking for some hint or notation how or where SolidWorks save the file open time and could it be read with a macro. The thing is that we use 3rd-party PDM and it seems that I need to instruct users to manually open some files from the vault since I think it is not accessible via VBA.
All in all, I want to read and show the user the time that SolidWork registered as ‘Open time’ which means that document is opened first and then the macro is run by user. Assembly visualization uses ‘SW-Open time’ as column header and file open time can be seen from file info when cursor is hovered over the file in Windows file explorer.
Any hints? I will continue my research tomorrow, but if I can’t find a solution, I will proceed with more manual labor intensive methods.
When you open a SOLIDWORKS file, it is recorded in the FileAccess.log file that SOLIDWORKS creates in the %APPDATA%\SOLIDWORKS folder. The data looks like this:
05/24/2022 14:46:12 OPEN “E:_EPDM\engineering\oracle\401xxx\401480.SLDPRT”
05/24/2022 14:46:12 OPEN “E:_EPDM\engineering\oracle\400xxx\400347.SLDPRT”
05/24/2022 14:46:12 OPEN “E:_EPDM\engineering\oracle\1xxxxx\125665.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\400xxx\400348.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\400xxx\400349.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\421xxx\421028.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\1xxxxx\109348.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\414xxx\414893.SLDPRT”
05/24/2022 14:46:13 OPEN “E:_EPDM\engineering\oracle\414xxx\414894.SLDPRT”
05/24/2022 14:46:14 OPEN “E:_EPDM\engineering\oracle\414xxx\414896.SLDPRT”
05/24/2022 14:46:14 OPEN “E:_EPDM\engineering\oracle\414xxx\414897.SLDPRT”
If you are opening an assembly, a crude approach would be to find the delta between the first and last timestamps.
I could use this information now, and I have apparently dismissed this message. I am not seeing it my dismissed messages in System Options. Anyone know what this is called?
Sometimes, the counter keeps rolling if you don’t close the window and you end up with numbers like that. I don’t know what makes the counter keep on going though.
I add this code to my macros that I want to log/show the process time (open, save, rebuild, etc).
Dim nStart As Single
Dim TimeElasped As String
nStart = 0
nStart = Timer
'***Process/Task Code Here***
TimeElasped = Format((Timer - nStart) / 86400, "hh:mm:ss")
MsgBox "This model opened in " & TimeElasped & " (hours:minutes:seconds)"