Caching Local files

Hey, all - I wanted to ask a general question about caching local files.

When working with an SW PDM add-in, in what situations, if any, would I need to cache a local file, while not needing to modify/open the file? For example, Move tree, add custom references, etc.

My understanding is that I do not need to cache if I’m not opening/editing the file via SW/SW Doc Manager API, but don’t know what I don’t know. I’m going to be working a lot with imported data, and am trying to come up with contingencies.

Your understanding is correct. You only need to cache stuff in order to modify or the read the content of files.

Few examples of API call that require caching:

You need to cache things is when you are getting a variable value from a specific version of a file via IEdmEnumeratorVariable5 Interface - 2014 - SOLIDWORKS API Help. GetVariableFromDb on the other hand will return the latest value from the db and will not require the file to be cached.

GetThumbnail requires caching.


Hope it’s okay to jump in with a follow up question that I think has bit me. Solidworks needs all referenced files to open a file, can we assume that Doc Manager does not?

As a bit of context to my specific context: I couldn’t print a pdf of a Solidworks drawing without getting the proper version of every, single, file used in the assembly model in the drawing. I was not used to that as Solid Edge can make a good pdf with just .dft file. So some thought me be required for all the files that you need read access to. I’m hoping that Doc Manager is different and does not need referenced files to function, but my experience with how $PRPSHEET behaves in drawings gives me doubts.