Add revision number to my PDF

Add revision number to my PDF

felix.bouchard
Contributor Contributor
449 Views
4 Replies
Message 1 of 5

Add revision number to my PDF

felix.bouchard
Contributor
Contributor

Hey guys, i have this ilogic rule to generate a pdf when i save a drawing. 

I would like it to add the revision number inside the drawing revision list when i save instead of creating a new idw file with the revision number. could someone help? Thanks.

strFolder = "D:\Novathermboiler\Pdf\" & ThisDoc.FileName(False) 'without extension
ThisDoc.Document.SaveAs(strFolder & (".pdf") , True)
MessageBox.Show("All file formats saved", "File Save")

 

0 Likes
Accepted solutions (1)
450 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @felix.bouchard.  Do you have this iLogic rule set-up so that it will run every time you save your ".idw" type drawing document, using Event Triggers?  Do you mean that you want the drawing's Revision Number/Letter to be added into the file name of the PDF when it exports the drawing as a PDF?  If you want the revision number added into the PDF file's name, then how do you want the final file name to look, or be formatted?  Some examples with and without the revision data in the file's name would be nice, so we know what difference is needed, and how to write the code to achieve that.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

felix.bouchard
Contributor
Contributor

Hi, currently, when i save my idw, a pdf file is created at the location in the rule. It keeps the same name as my idw file. 

 

What is need is the pdf file to have the idw name + the revision number that is inside my revision table in the idw. 

 

so ex : xxx, Rev0

            xxx, Rev1

 

Thanks. if posible, i would like to keep the part of the code i have since im not the only one using it. 

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor
Accepted solution

Hi @felix.bouchard.  Not very good examples, because I don't think commas (,) are allowed in file paths or file names.  So, I left out the comma, but put a space in there right after the file's normal name, then the text "Rev" then the value retrieved from the 'Revision Number' iProperty, then the ".pdf" file extension.  I hope this will do what you wanted.  I just added one more line of code to it, for retrieving the Rev value, then made an alternative line of code for saving the file, then put an apostrophe in front of your old Save line, to comment it out for now, while leaving it in place.

strFolder = "D:\Novathermboiler\Pdf\" & ThisDoc.FileName(False) 'without extension
Dim oRev As String = iProperties.Value("Summary", "Revision Number")
ThisDoc.Document.SaveAs(strFolder & " Rev" & oRev & ".pdf", True)
'ThisDoc.Document.SaveAs(strFolder & ".pdf", True)
MessageBox.Show("All file formats saved", "File Save")

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

felix.bouchard
Contributor
Contributor

Thanks a lot! it does work with the comma! 

 

You are a time saver my friend.

0 Likes