# Archi-lab Batch Print Node Problem

**URL:** <https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575>\
**Category:** Developers\
**Created:** [October 6, 2016, 12:09pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575 "2016-10-06T12:09:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 6, 2016, 12:09pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/1 "2016-10-06T12:09:28Z")

</div>

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.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/5/5de390b250c54f347ffdaa6c628484af2e3b3b31.png)

here is how i set up the a2 print settings

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/9/964f0ecc4d834ee6e9ae6c4c2f6bfaddb0a043b7.png)

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

Anyone who can help is welcome!

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 7, 2016, 10:56am UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/2 "2016-10-07T10:56:49Z")

</div>

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)  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/a/a65e8e0e4b122d36fae387d691698cb7a88141fa.png)

here you can find the code :  
[https://gist.githubusercontent.com/ksobon/a571a2c7378e3bd610e7/raw/7911100eeb4222b15239a5f9bbd717ac4298651f/printPDF.py](https://gist.githubusercontent.com/ksobon/a571a2c7378e3bd610e7/raw/7911100eeb4222b15239a5f9bbd717ac4298651f/printPDF.py)  
It is posted [here](http://archi-lab.net/printing-pdfs-w-dynamo/)

#Copyright© 2015, Konrad K Sobon

# @arch\_laboratory, [http://archi-lab.net](http://archi-lab.net)

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

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 7, 2016, 1:15pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/3 "2016-10-07T13:15:14Z")

</div>

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](http://archi-lab.net/wp-content/uploads/2015/07/Capture1.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 7, 2016, 1:18pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/4 "2016-10-07T13:18:10Z")

</div>

> [@viktor\_kuzev](#):
>
> t seems that you feed only the print settings for one shee

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…

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/0/0006a3ff598f74c84ec9805c0f9c493ec05f1447.png)

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 7, 2016, 10:13pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/5 "2016-10-07T22:13:30Z")

</div>

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

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/9/9b27f64aeb097756aa40ea2c9e2379f04bf1c8f5.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 8, 2016, 4:49pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/6 "2016-10-08T16:49:49Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 8, 2016, 5:02pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/7 "2016-10-08T17:02:21Z")

</div>

Yep you are right.  
This is an easy fix though:  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/df68412266817f0d09c5cbdd47790c4a2fbb2baa.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 8, 2016, 5:12pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/8 "2016-10-08T17:12:36Z")

</div>

Thank you! That was very handy.

---

<div class="post-metadata">

**Author:** ![Lknapton](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lknapton](https://forum.dynamobim.com/u/Lknapton)\
**Post date:** [October 17, 2016, 12:02pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/9 "2016-10-17T12:02:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 17, 2016, 12:05pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/10 "2016-10-17T12:05:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lknapton](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lknapton](https://forum.dynamobim.com/u/Lknapton)\
**Post date:** [October 17, 2016, 12:06pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/11 "2016-10-17T12:06:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 17, 2016, 12:08pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/12 "2016-10-17T12:08:12Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Lknapton](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lknapton](https://forum.dynamobim.com/u/Lknapton)\
**Post date:** [October 17, 2016, 12:10pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/13 "2016-10-17T12:10:15Z")

</div>

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

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d80fcd0b7620742396299047defc99e6ffc3f318.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 17, 2016, 12:13pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/14 "2016-10-17T12:13:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lknapton](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lknapton](https://forum.dynamobim.com/u/Lknapton)\
**Post date:** [October 17, 2016, 12:20pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/15 "2016-10-17T12:20:34Z")

</div>

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

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/48486a449e736ec3c75081ad38b08d410a82739c.png)

---

<div class="post-metadata">

**Author:** ![Petar\_Penchev1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/petar_penchev1/32/8592_2.png) [@Petar\_Penchev1](https://forum.dynamobim.com/u/Petar_Penchev1)\
**Post date:** [October 17, 2016, 12:25pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/16 "2016-10-17T12:25:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [October 17, 2016, 12:39pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/17 "2016-10-17T12:39:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lknapton](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lknapton](https://forum.dynamobim.com/u/Lknapton)\
**Post date:** [October 17, 2016, 1:06pm UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/18 "2016-10-17T13:06:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Thomas\_Pedersen1](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Thomas\_Pedersen1](https://forum.dynamobim.com/u/Thomas_Pedersen1)\
**Post date:** [November 1, 2016, 10:52am UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/19 "2016-11-01T10:52:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Thomas\_Pedersen1](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Thomas\_Pedersen1](https://forum.dynamobim.com/u/Thomas_Pedersen1)\
**Post date:** [November 1, 2016, 11:15am UTC](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575/20 "2016-11-01T11:15:49Z")

</div>

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.

[Next page](https://forum.dynamobim.com/t/archi-lab-batch-print-node-problem/6575.md?page=2)
