Do you have pdm professional or pdm standard?
If you have standard then probably not. If professional then definitely. And easy.
Answer what vault product you have then we can proceed.
We have PDM professional
ok to do this you will need to write a solidworks addin or macro. macros fire when asked to, they can also be events but more complicated and less reliable as the end user has to either launch solidworks in a macro state or click a button.
addins are always best in my opionion.
what you need to do is start writing. if your not capable of doing it you will need to find someone to hire. i will not write this for you but there are some on here who do this for a living, Keith Rice at CADSharp does this.
i push people to him on here recently because they are great at developing this type of stuff.
Steps to achieve this:
execute some sort of check, if it fails the check, get the drawing document from the vault using your own code.
you will then need to use the EPDM API to get the IEDMFile from the IEDMVault object
once you have the file you can execute a 2016 SOLIDWORKS API Help - LockFile Method (IEdmFile5)
once it is checked out (Locked) then you can open and update the drawing with your custom code.
then when completed, execute 2016 SOLIDWORKS API Help - UnlockFile Method (IEdmFile5)
if you have not written any code before i would suggest attempting it as its very powerful. i didn't write any code until 5 years ago. i started with solidworks automation. so it can be done without any programming experience and training.
I'm am familiar with writing macros on a simple basis. And have actually created a macro that indeed does check out the drawing, opens it, saves it, closes the drawing and checks it back in.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim pdmVault As Object
Dim strFullPath As String
Dim strFolderPath As String
Dim strFileType As String
Dim intFileType As Integer
Dim i As Integer
Dim strFileName As String
Set swApp = Application.SldWorks
strFullPath = "<Filepath>"
strFolderPath = "<Path>"
'Limit the macro to SLDDRW files
strFileType = LCase(Right(strFullPath, 6))
Select Case strFileType
intFileType = 3
'Grabs filename only
i = InStrRev(strFullPath, "\")
strFileName = Right(strFullPath, Len(strFullPath) - i)
'Create vault object
Set pdmVault = CreateObject("ConisioLib.EdmVault")
pdmVault.loginauto "[vaultName]", 0
Dim folder As Object
Set folder = pdmVault.GetFolderFromPath(strFolderPath)
Dim file As Object
Set file = pdmVault.GetFileFromPath(strFullPath, folder)
'Check out if needed
If False = file.IsLocked Then
file.LockFile folder.ID, 0
Set swModel = swApp.OpenDoc(strFullPath, intFileType)
If True = file.IsLocked Then
file.UnlockFile 0, "Checked in by Macro"
And it does just that. in the PDM vault I can see that the modified column (i think this is a MS explorer column) is updated, but description column is not updated.
The code is executed as a task script
So I'm confused then. What are you looking for here? You have the code. Find the typo, check the file and drawing out and update them.
What specifically are you stuck at? Then I can try to help.
I can see that the code grabs the correct files. As illustrated on the picture the files is checked out. based on the date and time i can see the files issaved and since my initials disappears i can see the the file is check in again. But the number is NOT updates.
If i do this process manually the number will indeed be updated.
is there a reason you aren't using the EPDM API?
make sure that the drawing is referencing the Latest Updated version of the part file. this may be your issue. it might be referencing the older non fixed version.
Do I need a video to explain myself correctly?
1. Manually checks out the drawing
2. Manually opens the drawing in SolidWorks
3. Manually rebuild the drawing
4. Manually saves the drawing
5. Manually closes the saved drawing
6. Manually checks in the drawing
The number 066164 DOES update to 184904.
The macro code above is EPDM API; otherwise i would not be able to check files in or out.
My macro does the EXACT 6 steps above but does NOT update the number! Hence my question. What EPDM API call am I missing to make it work.
per your comment "Do I need a video to explain myself correctly?"
i will no longer try to help you. good luck.
I'm not trying to be rude or anything, but the amount of questions you ask to which I feel I have already explained extensively enough in previous post was actually starting to make me think you were trolling me or something.
Any way thanks for trying. Good luck to you too
I´m also very interested in a solution for this.