Batch PDF with multiple sheet sizes


#1

Hi All

I have recently completed an automated PDF graph that allows me to print the sheets within a specified view set to pdf and rename them accordingly.

The only downside that I can see so far is that if the view set has a number of different sheet sizes / orientation then I have to create a whole new viewset to cater for the different print settings.

Is it possible to print a viewset that caters for all the different sheet sizes without having to manually change them.

I have seen a few previous topics but none seem to have a solution.

I am still new to Dynamo so I apologise in advance if I am not up speed.

Any help would be appreciated.

Thanks

Jordan


How to print multiple PDFs with different paper size
#2

Hi Jordan,

could you share your graph?

thank´s
Johannes


#3

I’ve had the same problem but @viktor_kuzev helped me with some adaptions which solved several problems including yours (and problems you would encounter later on :wink: ), so now it is time I pass my acquired knowledge along to you.

  • copy the contents of the origional node into a new one (for backup purposes, we dont want the node to be overridden when you update the archilab package)

  • replace the code in the python node with this code:
    batch pdf.txt (4.3 KB)

now you are able to feed a list of printsettings into the node.
the list needs to be equaly as long as the list of sheets.

depending on how your Title Block is setup you can extract the size/orientation from there.
I chose to name the title block types like this to extract the information.
A1 portrait
A1
A2 portrait
A2
etc.

you’ll need a printsetting for every possible size/orientation combination.

hope I helped you.


#4

Hi @timhevel

Thanks for the help / code.

When you say that you need a print setting as long as the list of sheets does that mean if there are 10 sheets within the view set you need 10 individual print settings nodes?

Apologies if that isn’t clear.

The thing that is confusing me the most is how you manage to connect the sheet size to the corresponding sheet name.


#5

sorry if i might have been unclear, but you need to make one printsetting in your revit project for every size sheet you have:

in dynamo you need to assemble a list of these printsettings. As you can see in the screenshot they dont have to be unique otherwise you would only be able to print one of each size :wink:

how you assemble the list depends on how your title block is setup, but you’ll probably need to use a boolmask


#7

Hi @timhevel

Unfortunately I have hit a brick wall with my graph.

I have managed to identify which titleblock is being used for which sheet within my View sets (see attached), but I don’t know where to go from here. Is there any chance you could point me in the right direction?

Once again thanks for the help and apologies for my lack of knowledge in Dynamo.


#8

So you need to match which title block/paper size to the correct print setting.
You could make a Print Setting parameter in your title block types, so each size has the name of the correct print setting. Then you get all sheets as a list, get the list of title blocks for each sheet, get the list of Print Setting names from each title block, then finally get print settings as a list to feed into the print node.

It might be better to make the Print Setting as a sheet parameter so you can manage it in a schedule, but then it wont change automatically when users change the title block.


#9

I think I have managed to get something to work… well, they are printing the different sheet sizes.

At the moment my current graph is picking the Sheet size up from the view instead of the titleblock. How do I go about getting it to pick it up from the titleblock instead?

EDIT: I spoke to soon… when trying it on a different view set with a different amount of sheets it failed to work :frowning:

Can anyone point out where I am going wrong ?


#10

your printsetting selection should look something like this: one group of nodes for each type of printsetting then combine all of the printsettings and all of the sheets. then flatten those lists




#11

Thank you very much timhevel. It worked perfectly after some time. Even with fomats over A0.
Great work. I really appreciate it.


#12

Hello Tim,

I’m getting an issue at the last stage of my graph in regards to renaming pdf’s.

If your graph includes that functionality would you be so kind as to share it with us please so I can highlight my mistakes.

Thank you,

Jack


#13

Your problem is probably that your graph tries to start renaming before your pdf writer is done making pdf’s right?


#14

Hello,

An easier way is to make this python code:

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = > DocumentManager.Instance.CurrentDBDocument

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

ids = doc.GetPrintSettingIds()

#Assign your output to the OUT variable.
OUT = ids

This will get all printsettings from your project.


#15

you can also do it like this:

but that is not the point. how do you determine which printsetting must be used on which sheet?


#16

@timhevel

First u get the printsettings from project:

Get the sheets from project u want to print (i use DataShapes in this case to print only 2 sheets):

Get Titleblocks and check if they match with the sheets u want to print (type name of the sheet must match with printsetting name).

Hope u can work it out (hard to explain).


#17

I quess both our methods work.


#18

Hello Tim and thanks for your reply.

I have now split them into two graphs and have isolated the issue with my graph. On the “Rename PDF’s Node” I seem to get an error message saying.

Traceback (most recent call last):
File “”, line 27, in
WindowsError: [Errno 17] [Errno 183] Cannot create a file when that file already exists.

I saw another post here Printing and renaming PDF from Dynamo saying I can replace that node with another one. But ideally I would like to continue using thus Archi-lab node, as I understand it’s workings a lot more.

Thank you for reading, Jack.

renaming sheets.dyn (16.5 KB)


#19

The Archilab rename node never worked for me either, I use the one by DanEDU.


#20

any chance you could share the successful graph.


#21

Hi Everybody, does this result in one pdf with multiple pages? Or one pdf per sheet?
Can anyone clarify?