I recently added a custom button (CardButton) to one of our EPDM File Cards via an Enterprise PDM Add-In.
Does anyone know how I can force a refresh/redraw of the file card once my routine has finished reformatting some of the fields?
If you create / show the card via the EPDM object of: IEdmCardView63, there is an Update method that updates the controls in the card.
Do you mean that you want to programmatically press the "save" button on the data card?
>>Do you mean that you want to programmatically press the "save" button on the data card?
Well, not really... the new variables have already been saved in the database. The file card (within Explorer) however displays the old values until it needs to refresh. I would just like to programmatically initiate that refresh. I have another Add-In that does it, so there must be a way.
If you're using BatchUpdate2, set the EdmBatch_RefreshPreview flag in the SetVar method.
Thanks, that looks like a possibility... unfortunately I used IEdmEnumeratorVariable8.SetVar().
If your method works however, worth the re-write.
I know it's been 4 years but I found this thread because I'm encountering the same problem. Could you provide an update on how you ultimately went about resolving your issue?
Andrew - Can you provide the sample code you are using. This may help to understand what you are doing and what the correct solution will be.
Like Greg, I am using IEdmEnumeratorVariable8.SetVar() to change a datacard field. That part works fine but you can't see that variable has changed in Windows Explorer unless you manually refresh the folder you're in. I've tried calling the parent folder's Refresh() method as well as refreshing using the vault's RefreshFolder(folder_path) method.
I think 4 years ago I came to the conculsion it couldn't be done. That, or I couldn't figure it out.
So, I came up with the crazy idea of popping up this goofy dialog box after updating variables...
Definitely the dumbest idea I've ever had, but it does the job. Four years later, I have a hundred engineers still cursing at me under their breath. lol
PS: Actually, the code I had to write to monitor SolidWorks for memory leaks so my task computers never crash was equally as ugly. But, you have to cross the finish line !
What version of SolidWorks PDM are using? I sort of remember that solidworks fixing the refresh option in the API. However, if you are using the latest version of PDM and it still does not work, you may be out of luck and go with the solution Greg came up with
Retrieving data ...