PDM: Get referenced versions instead of latest by default

We need to get referenced versions of files when we open them, not get latest. So all the various ways people will open a file; double click from search results/vault view, connisio link in review notification email, recent files, etc should update the cache to the version that was referenced the last time the file was checked in, all the way down the tree.

This functionality does not exist in PDM and no indication if it ever will or when. Does anyone have suggestion of where to start or if it’s even possible to prevent PDM from getting latest (if the ref file not in local cache) and then do a get by reference for any of the ways the file might be opened? Many of those times the RFD doesn’t show up, which is fine most of the time, but I have to wait for PDM to find all the refs then update cache to latest just so I can go do a manual get referenced.

This is like Christopher Columbus coding for me as I don’t have much of an understanding of all the various APIs functions. I don’t really know where to start. I just want everyone using the referenced version by default.

Thank you.

GetFileCopy Method (IEdmVersion5) - 2017 - SOLIDWORKS API Help will do that. An add-in that adds a new menu item that calls the API will get you what you know. Preventing PDM from getting the latest version is not a good way to go about this. Open/Close principles for good programming dictates software should open to extension, closed to modifications.

Thanks Amen. I’ve used the GetFileCopy just a couple of times now, rewrote one use to the BatchGetter method once better understood how to use it.

An add-in that adds a new menu item that calls the API will get you what you know.

I think you’re talking about a file right click menu item that would do a get referenced of all the files needed then open it in SW. A custom open. I supposed it could also be a stand alone exe as well that could be selected with right click → “open with” then check the box to always use.

Open/Close principles for good programming dictates software should open to extension, closed to modifications.

I’m sorry, but I do not follow. Could you give a simple example?

1 Like

Absolutely.

If a program has a feature, you do not interfere with the correcting functioning of that feature through the program’s API. In our case, if I understand you correctly, preventing PDM from performing check-out through the API constitutes that modification. You are much better off adding a new menu item in PDM that allows you to get the version you want…

Hope this makes sense. Let me know if I did not understand you correctly!

1 Like

I see. That example makes sense. I think it’s a matter of “we’re doing it wrong” :wink: or just using PDM in a way it was not intended or expected to be used. It seems PDM is intended that the latest version is always used; we cannot do that. So the hard coded behavior of getting latest or using whatever is in local cache on file open (even edrawings for non CAD users) is causing much confusion. So what you’re saying is bad API programming practice is exactly what I need to to.

I’m not saying it’s not a bad practice (sorry for double negative), its just that the hard coded behavior of get latest or use what’s in cache is wrong for the way we use our data.

The longer we use PDM the more I see problems of wrong version being used, especially by people that don’t notice it. The Solidworks PDM add-in makes it more obvious which version is in use once the proper columns are added. When I consider non CAD users in other departments using eDrawings from a link in a notification email or double clicking a search result, they have no idea they’re looking at the wrong versions of the parts and eDrawings will not tell them. That case is most concerning as it gets more complicated to identify what’s going on because Solidworks will rebuild (or try to) on open; I just don’t know what type of updating eDrawings will do when the versions of components in local cache are different than when the drawing or model was lasted saved on some other computer. Or does eDrawings show an assembly without accessing the part files, even if they are in local cache? Note, we have the View File setting for the solidworks file types to not cache references; but that only applies when they right click “view file” if eDrawings is set as default program then links in notification emails and double clicking will still get latest of referenced files that are not in cache and will cause different behavior.

image

The only solution I can see to this is to somehow get PDM to default to get by reference always.

1 Like

PDM Web is probably a good idea for sharing data with non-cad users. Version info can be included.

I might have found how to turn off automatically get latest while I was working on another task. Not saying I’m ready to check this box just yet, but it is in my mind to test behavior. If this were checked for the Solidworks file types then a PDM addin hook to the EdmCmd_PreGet command (I’m not seeing a PreOpen command) that would get referenced files by version.

This could also be a big help to us in the cases where there are dozens of drawings using some “optional” part. In that case it takes several minutes for PDM to get all the refs because it gets all the drawing nodes, then gets every part in all those drawings as well.

1 Like