How do you read/write PDM Vault properties (such as Revision) from a Solidworks CAD API?

I know SOLIDWORKS will unload and reload the document when file is checked-out an checked-in. I have tried this event: DPartDocEvents_FileReloadNotifyEventHandler but this event is firing confusingly (i-e it is only firing for SolidWorks.Interop.sldworks.PartDoc and not for SolidWorks.Interop.sldworks.AssemblyDoc) and sometimes this event totally not fired on checked-out an checked-in.

I know, we need a PDM vault database access for this but the SW add-in I created will be deployed to dozens of clients, so I don't think it would be good to ask credentials for their vault and the clients will not appreciate.

Other than that, I wanted to know if there is any other solution we can implement without creating PDM add-in which will communicate with my CAD add-in?

Thanks.

SolidworksSolidworks Pdm/enterprise Pdm
Comments 10
KO
KO 2021-04-08

In my vault variable settings, these are linked to 2020-01-17_1743 

KO
KO 2021-04-08

I have a SW Add-in not PDM add-in, I wanted to read PDM vault variables from my SW CAD Add-in. Is it possible?
I know it is possbile with the PDM add-in but I don't have that. I wanted to read info from my SW add-in.

MZ
MZ 2021-04-08

It should be possible if you can access the database.

You can even open the interface to PDM from Excel using VBA.

KO
KO 2021-04-08

It means, without PDM vault database access, it is not possible with Solidworks API. Right? 
Also,
Do we have any documentation?

MZ
MZ 2021-04-08

Well, the values you want to process must come from somewhere. Without access to the database, I think it's difficult.
The documentation is available in the installationpath of PDM.
   "C: \ Program Files \ SOLIDWORKS PDM \ API_GB.chm"

Why don't you want to connect the database?

KO
KO 2021-04-08

Thanks, this *API_GB.chm* documentation is all about PDM add-in as I said earlier, I have SW add-in not PDM add-in and I want to read info from my existing add-in, don't want to build a separate PDM add-in for that.
Also,

My SW add-in, will be deployed to dozens of clients, so I don't think it would be good to ask credentials for their PDM Server Vault Database and the clients will not appreciate.

MZ
MZ 2021-04-08

Hmmm...

You can use SSO to connect the DB. With "LoginAuto Method (IEdmVault5)" nobody will be asked to enter anything.

KO
KO 2021-04-08

Again the LoginAuto is PDM API method and I am not using PDM add-in. I have a CAD add-in which is build with this 2012 SOLIDWORKS API Help - Using SwAddin to Create a SolidWorks Addin .

AT
AT 2021-04-08

PDM variables in most cases linked to SW custom properties (unless version free variable). So you can read the values via  

Depending on your vault settings the variable names and the linked custom properties may have different names. Check your variable settings in vault and see what blocks they are linked to.

MZ
MZ 2021-04-08

I don't think I fully understand your question.
If I call up variables in PDM, are they still available in the file if its open from PDM ?!