AnsweredAssumed Answered

Is there a way to check if a file is checked in using the solidworks API? PDM Standard

Question asked by Shane Plohl on Jul 5, 2017
Latest reply on Jul 5, 2017 by Shane Plohl

Hi,

I have a macro that saves a drawing to a PDF within PDM. I have checks to ensure the PDF isn't open, but nothing to check whether the file is checked in or out. I have had a bit of a look, but can't see to figure if there is a check to see if the file is writable. Each time the macro is used, it will overwrite the existing pdf, if the pdf is checked in, I would like it to notify the user the PDF is checked in and cannot be overwritten.

At the moment, the macro just crashes solidworks...

 

Any one have any ideas?

 

For reference, I have attached a copy of the macro. It crashes at line 192 "swDraw.SaveAs (NewFilePath)", which I expect because it can not overwrite the file.

 

Kind Regards,

Shane

p.s. This is my first major attempt at a large macro, and it is a cut and paste of various snippets from the internet to get things to work. Any general comments would be greatly appreciated.

Attachments

Outcomes