Print to PDF (Filename and Rev Number from custom proporties)



I have a macro that I use to generate a PDF of an open drawing. My drawing filename is simply the part number. I want to change the macro to append a revsion to the end of the filename before saving as a PDF. I carry the current rev in a custom proporty in the part madel, I have a note on my sheet format that references to this which displays in the title block.

I do not know how to access the proporties of the referenced model like my notes/annotations do e.g. (\$PRPSHEET:CurrentRev).

Any Ideas please.

(I found the macro on this website)

Excuse my ignorance for not knowing how to alter it.  

I also have this link which asks the same question, but again, I do not know how to alter, cut or paste code together. (Sorry)

http://compgroups.net/comp.cad.solidworks/api-get-custom-prop-from-referenced-model/15615

SolidworksApi macros