Archi-lab Batch Print Node Problem

Hi There,

I set up a test project with four sheets - two size A1 , and two size A2.
The main goal is to print the both sizes with one node ( I’m using Print PDF from archi-lab package) but there is a problem
even when I’m trying to print one paper size. It seems that everytime the pdf are printed with defoult printer settings, no matter what I feed in Print Settings input. When I run my definition the result is two pdf’s but with wrong print settings.From the pictures you can see the definition.

here is how i set up the a2 print settings

No matter that when I print the pdf is printed on A1 paper.

Anyone who can help is welcome!

1 Like

Hi All,

I’ve tried different scenarios and definitions but with no actual result.
But I found somthing very interesting. For some reason the node does not read from the Print Settings Input.
No matter what you connect it will always print with the last applied print settings.
So I believe this is the problem with the node.
Here is the definition showing how the node is working with no Print Settings input ( i’ve connect just a watch node)

here you can find the code :
https://gist.githubusercontent.com/ksobon/a571a2c7378e3bd610e7/raw/7911100eeb4222b15239a5f9bbd717ac4298651f/printPDF.py
It is posted here

#Copyright© 2015, Konrad K Sobon

@arch_laboratory, http://archi-lab.net

Hope someone has an answer to the problem, may be @Konrad_K_Sobon can help, too = )

It seems that you feed only the print settings for one sheet. To be able to print with different settings you must have a list of settings corresponding to the list of views as shown on this image by Konrad:

http://archi-lab.net/wp-content/uploads/2015/07/Capture1.png

I’ve already tried to connect 4 print settings with 4 virews but in that case
all 4 views are printed with the print setting selected by default in print dialog (ctrl+p)

EDIT: Here you can review the definition. The result here is four pdf’s successfully printed, but all with one print setting → the print setting defined in the print dialog not even the first item in the Print Setting list…


Try to add these lines in the Python node inside Print PDF

Thank you, now it works!
There is a little problem, though.
Now If I feed single Print Setting it doesn’t work but it does perfectly with a list of Print Settings, great job!

Yep you are right.
This is an easy fix though:

1 Like

Thank you! That was very handy.

@Petar_Penchev1 Sorry to be pain, could you post the code? Having difficulty getting this to work :confused:

Here is the code - https://drive.google.com/file/d/0B5Srrp8d3ZYCaG9ITVk4SEdMWEE/view?usp=sharing - thanks to @viktor_kuzev

@Petar_Penchev1 Would it have anything to do with dynamo version? I can only use Dynamo 1.0 in work.

I don’t know. I believe the version of dynamo is not a problem. Could you share the error or the problem that you have, so we are able to help you? What is wrong ?

Thanks for quick reply, i have copied your code and getting the following error.

For sure now the Combined Files option is not working.
You should choose “False” for CombinedFiles.
You could combine the files after you print them.

The problem which is reported is the file name. You Should choose something with *pdf extension.
You could use whatever you want, for example - sample.pdf and use not directory path but file path node.

I have switched CombinedFiles to False and replaced directory path with file path and now getting a null error. :slight_smile:

Hmmm, I’m not sure what is the problem now.
Everything should be working now.
Try to change the file path to different directory - sometimes this works
and of course try to restart revit and dynamo.
Otherwise I don’t know that could be the problem.
Be sure you’ve changed the Python Script properly and your inputs are correct.

Did you try setting “RunIt” to false then run and then set it to true and run again?

Nope none of the above worked, still null error. Thanks for all the help though.

I’m also getting the “null” value, both when running with “RunIt” set to “True” and “False”…

After restart of Revit and Dynamo, it produces error in Revit when running with “RunIt” set to “False”. Error is “[Printer Name] cannot be used with [Print Settings]. The print settings will be used”.

The shown [Printer Settings] is correct in this instance, but the [Printer Name] value is not corresponding to the value given in Dynamo.
Don’t know if this helps or adds to the confusion?

Ok, when trying to isolate the problem, it seems that it’s when this piece of code is added, that the “null” error is produced:

TransactionManager.Instance.EnsureInTransaction(doc)
printManager = doc.PrintManager
printSetup = printManager.PrintSetup
if isinstance(printSettings, list):
printSetup.CurrentPrintSetting = printSetting[0]
else:
printSetup.CurrentPrintSetting = printSetting
printManager.Apply()
TransactionManager.Instance.TransactionTaskDone()

Maybe that will help.