Page 1 of 1

How SolidWork records file open time?

Posted: Tue May 24, 2022 9:46 am
by JuTu
Hi again!

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.

TIA!

Re: How SolidWork records file open time?

Posted: Tue May 24, 2022 10:09 am
by mike miller
I don't know how SWX records it, but I know it can be way off the deep end sometimes.
2022-03-10 15_14_53.jpg

Re: How SolidWork records file open time?

Posted: Tue May 24, 2022 10:56 am
by JSculley
JuTu wrote: Tue May 24, 2022 9:46 am 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?
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.

Re: How SolidWork records file open time?

Posted: Thu Jul 21, 2022 3:01 pm
by MattW
mike miller wrote: Tue May 24, 2022 10:09 am I don't know how SWX records it, but I know it can be way off the deep end sometimes.

2022-03-10 15_14_53.jpg

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?

Re: How SolidWork records file open time?

Posted: Thu Jul 21, 2022 3:11 pm
by JSculley
Assembly Open Progress Indicator:
image.png

Re: How SolidWork records file open time?

Posted: Thu Jul 21, 2022 3:45 pm
by AlexLachance
mike miller wrote: Tue May 24, 2022 10:09 am I don't know how SWX records it, but I know it can be way off the deep end sometimes.

2022-03-10 15_14_53.jpg
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.

Re: How SolidWork records file open time?

Posted: Thu Jul 21, 2022 7:56 pm
by MattW
JSculley wrote: Thu Jul 21, 2022 3:11 pm Assembly Open Progress Indicator:

image.png
Didn't have that one listed, but there was one listed for "Drawing open Progress Indicator". That seems to have done it.

Re: How SolidWork records file open time?

Posted: Fri Jul 22, 2022 7:33 am
by JSculley
MattW wrote: Thu Jul 21, 2022 7:56 pm Didn't have that one listed, but there was one listed for "Drawing open Progress Indicator". That seems to have done it.
There are individual dialogs for each document type:
image.png

Re: How SolidWork records file open time?

Posted: Thu Oct 06, 2022 12:47 pm
by starshiphalo2333
I add this code to my macros that I want to log/show the process time (open, save, rebuild, etc).

Code: Select all

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)"