Changing PDF options with API

Changing PDF options with API

Anonymous
Not applicable
834 Views
2 Replies
Message 1 of 3

Changing PDF options with API

Anonymous
Not applicable

I have the following iLogic code in a drawing, and three other rules just like it that save the Engineering, Installation Template, and QC sheets in the drawing under their respective names.

 

' Activates the marketing sheet and saves it as a PDF under the name
' "partnumber REV# Marketing" and displays a confirmation
ActiveSheet
= ThisDrawing.Sheet("Marketing") pdfFile = CStr(ThisDoc.FileName(False)) & " REV" & _ CStr(iProperties.Value("Project", "Revision Number")) & " Marketing.pdf" ThisDoc.Document.SaveAs(pdfFile, True) MessageBox.Show("Marketing PDF saved", "All clear")

My problem is that there are three sheets to the Engineering portion of the file, and just a single sheet to the others. So, if the user has their PDF options set to "current sheet," the code works fine for the Marketing, Installation, and QC sheets, but only saves a single sheet of Engineering. You can change the options to "all sheets" to get the three Engineering sheets into one PDF file, but then you can't save the single sheets for the others unless you go back into PDF options and change the preferences, which basically defeats the purpose of having the code in the first place.

 

I was wondering if there is any sort of code I can add that checks what the PDF options are set to, and also changes them to match the sheet that is selected ("current sheet" for Marketing, Installation, and QC and "all sheets" for Engineering).

0 Likes
Accepted solutions (1)
835 Views
2 Replies
Replies (2)
Message 2 of 3

pball
Mentor
Mentor
Accepted solution
I don't believe you can with the saveas pdf code. You can use a different method of creating a pdf to access more options though. The thread below has the code to export a pdf and select the sheets you want. The code is longer but you could make a function out of it.

http://forums.autodesk.com/t5/inventor-customization/ilogic-rule-to-export-custom-number-of-pdf-shee...
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 3 of 3

Anonymous
Not applicable

The link was really helpful, thanks pball!

0 Likes