This is through a feature called iLogic. On your Ribbon, go to Manage>iLogic>iLogic Browser, this brings up a browser pane that you can drag around or snap just like your Model browser. In the iLogic Browser, go under the Rules tab, right click in the open space and click Add Rule. Name this rule whatever you want and click OK. Then paste the code into the space. The code used in iLogic is called Visual Basic if you'd like to learn more about it. After the code is in there, click save then close the rule. Whenever you want to run the rule, right-click on it and click Run Rule. Like I said before, this code is designed to run from an assembly document with no other Inventor documents open.
EDIT: I missed a couple of lines in my previous post, here's the updated code:
SyntaxEditor Code Snippet
'['Sub Variables
oRefDocs = ThisApplication.ActiveDocument.AllReferencedDocuments
Dim oDoc As Document
oFolder = ThisDoc.Path
oAddIns = ThisApplication.ApplicationAddIns
oTG = ThisApplication.TransientObjects']
'['PDF Export
'['PDF Options
PDFAddIn = oAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oContext = oTG.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = oTG.CreateNameValueMap
oDataMedium = oTG.CreateDataMedium
oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 4800
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintCurrentSheet']
For Each oDoc In oRefDocs
idwPathName = Left(oDoc.FullDocumentName, Len(oDoc.FullDocumentName) -3) & "idw"
If System.IO.File.Exists(idwPathName) Then
oDrawDoc = ThisApplication.Documents.Open(idwPathName, True)
For Each oSheet As Sheet In oDrawDoc.Sheets
oSheet.Activate
oDataMedium.FileName = oFolder + oSheet.Name + ".pdf"
Call PDFAddIn.SaveCopyAs(oDrawDoc, oContext, oOptions, oDataMedium)
Next
oDrawDoc.Close(True)
End If
Next']
MessageBox.Show("PDF Export completed.", "PDF Export", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
EDIT: If you'd like to learn or ask more about iLogic code, the Inventor Customization forum is a better place than the regular forum.