How SolidWork records file open time?

Programming and macros
User avatar
JuTu
Posts: 81
Joined: Thu Mar 25, 2021 4:00 am
Answers: 1
Location: Finland
x 55
x 35

How SolidWork records file open time?

Unread post 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!
Sincerely,
JuTu
__________________
Lentäjä on ulkona ja lukossa.
User avatar
mike miller
Posts: 878
Joined: Fri Mar 12, 2021 3:38 pm
Answers: 7
Location: Michigan
x 1070
x 1231
Contact:

Re: How SolidWork records file open time?

Unread post 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
He that finds his life will lose it, and he who loses his life for [Christ's] sake will find it. Matt. 10:39
User avatar
JSculley
Posts: 638
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 868

Re: How SolidWork records file open time?

Unread post 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.
MattW
Posts: 58
Joined: Wed May 12, 2021 12:39 pm
Answers: 2
x 5
x 31

Re: How SolidWork records file open time?

Unread post 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?
User avatar
JSculley
Posts: 638
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 868

Re: How SolidWork records file open time?

Unread post by JSculley »

Assembly Open Progress Indicator:
image.png
User avatar
AlexLachance
Posts: 2174
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2353
x 2008

Re: How SolidWork records file open time?

Unread post 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.
MattW
Posts: 58
Joined: Wed May 12, 2021 12:39 pm
Answers: 2
x 5
x 31

Re: How SolidWork records file open time?

Unread post 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.
User avatar
JSculley
Posts: 638
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 868

Re: How SolidWork records file open time?

Unread post 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
starshiphalo2333
Posts: 9
Joined: Fri Sep 30, 2022 11:49 am
Answers: 0
x 1

Re: How SolidWork records file open time?

Unread post 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)"
Post Reply