Hi Josh Brady,
Thanks your prompt reply. I search the key word "verisonhistory" in SW API help.
the code is as below:
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim vVerStr As Variant
Dim i As Long
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Debug.Print "File = " & swModel.GetPathName
If IsEmpty(vVerStr) Then
vVerStr = swApp.VersionHistory(swModel.GetPathName)
If Not IsEmpty(vVerStr) Then
For i = 0 To UBound(vVerStr)
Debug.Print " " & vVerStr(i)
Debug.Print " No version information."
checking the result after running the macro, I found something not understand(pls check the attached screen capture):
for example, "4100[2008/251] " , as I know the "4100" means SW2009, refering to the general version information ; However, "[2008/251]" , it is incomprehensible. Is there any reference or learining material for understanding the content inside " [ ]".
pls help to advise.
thanks a lot
I believe that "251" is the day of the year that the release was created on.
thanks Simon, I guess so , "251" may mean the day number of that year. But I still have a query,
For example, I created a part by SW2013 SP4.0, then used that macro to check , result : "[2013/186]", then "186" means 5,July 2013. I check the release date of service pack 4.0 on the customer portal of www.solidworks.com", it is 15,July 2013.
So what I do not understand it is where or how to check the real released date of a service pack verison ?
I'm guessing that whatever part of the SolidWorks program that records SP release date into the program has to be completed at some time before the official release date. These will probably always be off by a few days. If you want your program to return the exact release date, you will need to create your own lookup table that matches the API call's release date to the customer portal actual release date.
I am just not very sure why the result date is different from the one in the customer portal for releasing the SP.
Making it clear from the SWx & API expert like you is very necessary for me.
Then I may output the result directly without any lookup table, perhaps with some note that tells the user it is just a reference, maybe not the exact one, but a close one. I have not always been picky.
thank you so much ! Indeed~