Hello
I'll try to explain my problem as best I can but it's not easy.
I use an excel macro to replace parts and assemblies in a model assembly.
My program works well on my PC but I just noticed a problem with the version of the assemblies that the macro will look for on another PC.
Example:
If I extract an assembly on my PC (PC1), modify it and then put it back in the PDM safe (I don't have any more extracts on my PC)
If, on another PC (PC2), I use my Excel macro and import this freshly modified assembly, the version I will recover is the version before modification.
Technically, the way my excel macro will fetch my assembly is very simple, my excel file contains assembly names and their locations and uses this code (below) to replace a model part (PIECE_A _REMPLACER) included in the ASSEMBLAGE_MODELE with the selected assembly (NEW_PART_NAME) which has the path NEW_PART_PATH:
boolstatus = swModel.Extension.SelectByID2(PIECE_A_REMPLACER & "@" & ASSEMBLAGE_MODELE, "COMPONENT", 0, 0, 0, True, 0, Nothing, 0)
boolstatus = swModel.ReplaceComponents2(NEW_PART_PATH & "\" & NEW_PART_NAME, "", False, 0, True)
Not understanding why the version of the assembly that the PC2 was opening I closed everything and manually searched (in PDM) for this assembly that I want to import into my model assembly then I opened it, and there .... the correct version opens (the version I had worldified on the PC1).
I close everything and then try my macro again via excel.... It works, it now imports the correct version of the solidworks file.
I first thought it was a problem with the PC2's cash memory and that therefore solidworks was opening what it had in its cash memory and not the latest version of each file.
Except that... on another try, I now try to import an assembly (always replace a part in my model assembly with this new assembly) that did not exist before in the PDM safe: the folder in which this new assembly is is did not exist before (the PC2 never opened the folder before).
On the PC2, I test my Excel macro and there the program reacts as if it couldn't even find the file in question... he moves on without doing anything.... although, as with the other parts, I give it a correct file name and location.
I redo everything, I look for this new file on the PDM of the PC2, I find it and open it... Everything is going well.
I redo everything and try my Excel macro again... It works, it finally finds the new file.
It would seem that via Excel, even if I give a valid file location, the macro does not have access to the latest version of the PDM vault, not just of a file but of any PDM.
Is there on each PC a kind of "cash memory of the PDM safe" or something like that?
So I was thinking, at the beginning of to my Excel macro, to add a line to empty this cash memory (if it exists) and therefore force the macro to go and draw from the current version of PDM and not a memorized one....
If you have an idea, or if I went completely in the wrong direction... tell me... maybe it's just in the way I look for my files in my macro...
Thanks in advance
Yves
PS: sorry for the lack of accents, I'm in the UK so QWERTY keyboard