Export Multiple Sheets To Separate PDF's

Anonymous

Export Multiple Sheets To Separate PDF's

Anonymous
Not applicable

Morning all!

 

Just wondering if there is a way to export each sheet within a drawing to its own PDF?

 

I have created 5 drawings, each with multiple sheets and I want to export them all as separate PDF's due to separate manufacturing processes needed.. Rather than sending them the entire drawing I would like to only send the relevant sheets of the drawing to them,

 

Is this possible or would I need to create an entire separate drawing for these sheets?

 

Many thanks and happy Monday!

Dylan

 

UPDATE:

I have been able to export each sheet to its own PDF but have had to save them all one by one, surely there is a way to make this a little quicker?

0 Likes
Reply
Accepted solutions (1)
6,703 Views
12 Replies
Replies (12)

mdavis22569
Mentor
Mentor

hi @Anonymous

 

Not sure of a way out of the box. BUT ..... iLogic might be possible.   The issue is getting it to stop.  Might need to put in the number of known sheets ....


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------
Mike Davis

EESignature

philip1009
Advisor
Advisor

This can be achieved with iLogic.  Could you provide a sample of what you you'd like to name each PDF and where to save it?  When you export the PDF, what options do you use?

Anonymous
Not applicable

Hi Phillip,

 

I use very similar formats across many different projects, for example,

 

CARN001-Bracket (would be a sub-assembly of a larger assembly)

Therefor within the CARN001-Bracket drawing would be multiple sheets with titles such as, CARN001-01-Bracket top, CARN001-02-Bracket Bottom, CARN001-03-Bracket Pin...

 

Im after saving them all as separate PDFs with names in a very similar format as the example above,

At the moment, I am opening the drawing with multiple sheets within, and manually exporting each sheet as its own PDF, which works but can take quite a long time if there are lots of parts and sub assemblies

0 Likes

Cadmanto
Mentor
Mentor

Dylan,

Maybe iLogic can expedite this quicker, and not sure if below is what you are talking about in your update, but you can print to pdf and just select the sheets you want or one at a time.

PRINT.png

 


Windows 10 x64 -16GB Ram
Intel i7-6700 @ 3.41ghz
nVidia GTS 250 - 1 GB
Inventor Pro 2018

 

Best Regards,
Scott McFadden
(Colossians 3:23-25)


philip1009
Advisor
Advisor

So you want to export pdf drawings of each part and assembly from a top level assembly, and each sheet would have it's own PDF?

 

Here's a sample loop that goes through each occurrence in the top level assembly and then goes into a secondary loop for each sheet in each drawing.  The name for each sheet is pulled from the name of the sheet in the browser, you just have to make sure each sheet name is unique otherwise it will overwrite other pdf sheets.  And all of the PDFs will be saved in the same folder as the top level assembly.  Let me know how this works for you:

 

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)

 

Anonymous
Not applicable

Thanks Cadmanto, 

 

I will have a look into iLogic and see if I can work something out using that,

The PDF's that I am creating are for the use of manufacturers, mainly so I can email certain parts to different manufacturers rather than sending them everything and confusing things,

 

At the moment I can use the singular save method and whatever iLogic will help with but I am trying to streamline the process as I am pretty new to the whole thing and want to make my life easier where possible Smiley Very Happy

0 Likes

Anonymous
Not applicable

That is exactly what I am after! 

To be honest though this is slightly out of my league, I looked at this and became instantly confused haha,

 

I think I understand what it means but would I need to input something like this myself? if so where would I find this kind of feature?

0 Likes

philip1009
Advisor
Advisor
Accepted solution

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.

Anonymous
Not applicable

Ahh thats brilliant thank you for explaining it in terms I understand Smiley LOL

 

I will definitely look into the iLogic rules then over the next few days and try to wrap my head around it, is it a feature you would recommend and is it a useful addition to everyday use of inventor?

0 Likes

philip1009
Advisor
Advisor

Basically, as you know, every company does their drafting and workflows differently.  Autodesk does it's best to cover all of the basic and general functionality and does more to cover more popular options, but it's impossible to make software that works for everyone specifically, that's where iLogic comes in.  To be clear, iLogic doesn't add or unlock any functionality that Inventor doesn't already have, it's just a tool of automating tasks, I definitely recommend learning it as it can be very powerful depending on your workflow.  On average I find automating design shortcuts or pushing mundane tasks to automation can decrease user time to about a 3rd of what it was before.  To learn more about coding in Inventor, click the drop down in the upper right corner of Inventor next to the help button, hover over the Help, and then in the pop-out from there is the Programming/API Help, just keep in mind that not all of that code can be used in iLogic as it has limitations.

peter.roman
Advocate
Advocate

How would you do this to only export the sheets of the active drawing / drawing with the rule (not all drawings of referenced drawings)?

I can't seem to get it to work

Thanks

0 Likes

Anonymous
Not applicable

Dear Sir

Thank you very much for code. I tried to implement it, but all drawings has no 0 kb mass. Additionally there are no pdf extension. When I added .pdf extension manually then files cannot be opened as well. Do you have any idea what is can be wrong? 

 

Best regards

Greg

0 Likes