Possible to choose subset of open drawings for making PDFs?

Possible to choose subset of open drawings for making PDFs?

claudio.ibarra
Advocate Advocate
981 Views
11 Replies
Message 1 of 12

Possible to choose subset of open drawings for making PDFs?

claudio.ibarra
Advocate
Advocate

I have an iLogic rule (.txt version of the .ilogicVB file attached) that takes all of the open drawings and makes PDFs in a desktop folder (adding the rev to the filename). The rule is currently triggered with a button on a global form.

 

What kind of tweaking would I need so that when the rule is fired, the user is shown a list of the open drawings and then chooses a selection from that list? This way if the user has 18 drawings open but wants to generate PDFs of 3 of them, they just choose the ones they want from the list instead of re-generating all of them.

 

Is that possible?

0 Likes
Accepted solutions (1)
982 Views
11 Replies
Replies (11)
Message 2 of 12

J-Camper
Advisor
Advisor
Accepted solution

I added a couple dialog boxes and loops to get the selection option you are interested in.  Test it and let me know if there are any issues or if you have questions.

 

I only modified the main sub

0 Likes
Message 3 of 12

claudio.ibarra
Advocate
Advocate

That works!! Thank you so much!! 

0 Likes
Message 4 of 12

harvey3ELEA
Advocate
Advocate

How would I go about modifying this iLogic script to write the PDFs with Revs to the project folder where the source drawing lives?

0 Likes
Message 5 of 12

WCrihfield
Mentor
Mentor

Hi @harvey3ELEA.  Here is another example of this type of process that may seem a bit simpler to look at.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 12

J-Camper
Advisor
Advisor

@harvey3ELEA,

 

All you need to do is change the "oFolder" String to read the directory of the drawing passed to the "PrintPDF" sub routine:

Dim oFolder As String = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) & "\PDF"

to

Dim oFolder As String = System.IO.Path.GetDirectoryName(oDoc.FullDocumentName)

 

I changed it in the attached .txt file.  Let me know if you have any questions.

 

0 Likes
Message 7 of 12

harvey3ELEA
Advocate
Advocate

That works great except for retaining colors.  What's the best way to turn all of the PDF black?

0 Likes
Message 8 of 12

J-Camper
Advisor
Advisor

@harvey3ELEA,

 

That is an option in the PDF export function "All_Color_As_Black".  In the original example it is set to 1 [or True]. In the example @WCrihfield posted it is set to 0 [or False].

 

All you need to do is change the number to 1 for True

Message 9 of 12

harvey3ELEA
Advocate
Advocate

Success JCamper!  Thank you very much!

Harvey

0 Likes
Message 10 of 12

harvey3ELEA
Advocate
Advocate

JCamper, I keep seeing "Defer Updates" kick on the drawings right when "PDFs Complete" window pops up.  Is this expected?

0 Likes
Message 11 of 12

J-Camper
Advisor
Advisor

@harvey3ELEA,

 

I do not know why the original code had the Defer Updates option set as part of the code.  In this thread I was just revising what was necessary to make some provided code work.

 

It looks like the option is set @ line 54 of the last .txt file I posted.  if you don't want that option to change you can comment out or remove it.

 

The whole containing If statement could probably be removed as it is just checking if active, changing the setting and saving. so you could removes lines 53-56 without changing how the export works

0 Likes
Message 12 of 12

harvey3ELEA
Advocate
Advocate

Kept it, but just set it to comment mode so it's now ignored.  Thanks again!

0 Likes