# Apply script to a number of Models

**URL:** <https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847>\
**Category:** Developers\
**Tags:** revit, python, dynamo\
**Created:** [January 4, 2024, 10:00am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847 "2024-01-04T10:00:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrea.dilisa95](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@andrea.dilisa95](https://forum.dynamobim.com/u/andrea.dilisa95)\
**Post date:** [January 4, 2024, 10:00am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/1 "2024-01-04T10:00:45Z")

</div>

Hello and happy new year!  
Here since I need to deploy one Dynamo Script to a number of models. I don’t want to manually open each model and run the script.  
Any idea on how to automate the process?

Thank you!

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [January 4, 2024, 10:03am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/2 "2024-01-04T10:03:56Z")

</div>

hello @andrea.dilisa95 I would try look into Birdtool multiplayer

[https://www.birdtools-developers.com/dmu.html](https://www.birdtools-developers.com/dmu.html)

or bvn revit batch processor

> **[GitHub - bvn-architecture/RevitBatchProcessor: Fully automated batch...](https://github.com/bvn-architecture/RevitBatchProcessor)**
>
> Fully automated batch processing of Revit files with your own Python or Dynamo task scripts! - GitHub - bvn-architecture/RevitBatchProcessor: Fully automated batch processing of Revit files with yo...

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [January 4, 2024, 10:15am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/3 "2024-01-04T10:15:38Z")

</div>

Hello and best wishes, is this what you should use when you want to run a script without launching the rvt file?  
you still have the inputs from the dynamo player which are displayed or you have to go through forms or data-shape.  
Sorry to pollute your thread a little Mr. andrea.dilisa

Sincerely  
christian.stan

---

<div class="post-metadata">

**Author:** ![andrea.dilisa95](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@andrea.dilisa95](https://forum.dynamobim.com/u/andrea.dilisa95)\
**Post date:** [January 4, 2024, 10:36am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/4 "2024-01-04T10:36:20Z")

</div>

Thank you @sovitek.

Is there a way of doing this my own to avoid third party tools?

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [January 4, 2024, 10:40am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/5 "2024-01-04T10:40:42Z")

</div>

Yes you could try with Background open, Rhythm have some nodes for that, but can be unstable if you try run on a lot of project files at once…thats why i think birdtool its better or bvn as these run on a single projectfile one by one

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 4, 2024, 10:45am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/6 "2024-01-04T10:45:04Z")

</div>

> [@andrea.dilisa95](#):
>
> Is there a way of doing this my own to avoid third party tools?

Might try writing it as a single Python node which takes a directory of documents as an input. Could be easy to do, or it could be a big lift, depending on what you are doing in the graph. Generally speaking I don’t recommend background opening with nodes as memory consumption is significant, and I have seen things go sideways on people.

---

<div class="post-metadata">

**Author:** ![andrea.dilisa95](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@andrea.dilisa95](https://forum.dynamobim.com/u/andrea.dilisa95)\
**Post date:** [January 4, 2024, 10:56am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/7 "2024-01-04T10:56:22Z")

</div>

So Python, manual opening or tools like the ones mentioned by @sovitek would be the way to go if I get it right.

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [January 4, 2024, 10:59am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/8 "2024-01-04T10:59:47Z")

</div>

I downloaded this a few months ago…

There’s one thing about it that really annoys me. “Bird Tools” appears in at the top of all my pop-ups while logged into Dynamo now.

I know it’s minor but I find it super irritating. 😆

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/a/0a102c6d1c28559c99f796b1d3a6b7209ee3c8b6.png)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [January 4, 2024, 11:06am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/9 "2024-01-04T11:06:25Z")

</div>

Hi @Alien hmmm try create an issue on the github or contact them via the webside,they can probably help…very nice and helpfull people

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [January 4, 2024, 11:07am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/10 "2024-01-04T11:07:45Z")

</div>

Thanks, I thought about it but it doesn’t appear when using Dynamo Player so it doesn’t really matter in the grand scheme of things.

It’s just me, I find it irritating. 😬

---

<div class="post-metadata">

**Author:** ![haganjake2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/haganjake2/32/119069_2.png) [@haganjake2](https://forum.dynamobim.com/u/haganjake2)\
**Post date:** [January 4, 2024, 11:12am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/11 "2024-01-04T11:12:15Z")

</div>

@andrea.dilisa95 I would definitely give the BatchProcessor suggested by @sovitek a go. It works flawlessly for your scenario and have found it to be incredibly powerful when needing to automate things across multiple models without having to open them.

You can even schedule it to run at night if you want to come in the next day and a task has been done whilst you sleep 😁!

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [January 4, 2024, 11:15am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/12 "2024-01-04T11:15:28Z")

</div>

I guess both can do it now BVN with a really windows taskschedule and birdtool with some timer but guess you pc had to be open…btw who sleeps in this buisness 😉 😉

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [January 4, 2024, 11:28am UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/13 "2024-01-04T11:28:02Z")

</div>

> [@jacob.small](#):
>
> Might try writing it as a single Python node which takes a directory of documents as an input. Could be easy to do, or it could be a big lift, depending on what you are doing in the graph. Generally speaking I don’t recommend background opening with nodes as memory consumption is significant, and I have seen things go sideways on people.

You also have to make sure you use nodes that work on the background opened document instead of the currently opened document as well, which can be a hard concept to get around/manage at first but definitely something to watch out for.

Why i do all background Opening tasks within python.

Though i will highlight that it is sometimes best to open a blank project in revit then run the script because if the currently none background file is linked in to a background opened file it can sometimes cause issues when opening projects.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 4, 2024, 12:44pm UTC](https://forum.dynamobim.com/t/apply-script-to-a-number-of-models/96847/14 "2024-01-04T12:44:30Z")

</div>

> [@Brendan\_Cassidy](#):
>
> You also have to make sure you use nodes that work on the background opened document

The problem with background opening and passing between nodes is that it requires you open a new copy of every model to start, and keep that copy open until all processes are updated on each model, and then close the models all at once when done.

The amount of RAM needed to effectively open a model is 20x the file size. Assuming it is large number of files (if it was three files just run it in player 3x as you won’t get ROI in building the larger tool), if you were to manually open the large number of models concurrently Revit would likely flip out with the hit on the RAM. So you would [open, perform the tasks, save, close] and repeat the process. Never having more than one file open at a time.

This is the advantage of Python based methods, as if you write the code carefully it follows the same process as the manual operation, while Dynamo [opens N times, processes everything N times, saves N times, and closes N times].

The same can be accomplished via a custom node, but nesting external custom nodes inside of custom nodes is problematic so you often have to resort to Python anyway.

All in Multi-Player is my personal preference for multiple automations (after design automation for cloud projects).
