# Open central file from revit server in background and change textnote text

**URL:** <https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206>\
**Category:** Revit\
**Tags:** revit, rhythm, dynamo\
**Created:** [April 23, 2021, 6:48am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206 "2021-04-23T06:48:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpaghettiWithNodes](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SpaghettiWithNodes](https://forum.dynamobim.com/u/SpaghettiWithNodes)\
**Post date:** [April 23, 2021, 6:48am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/1 "2021-04-23T06:48:20Z")

</div>

Hey I am trying to design a dynamo script to automate the process of maintaining revit files from a revit server.

Unfortunately, I have a problem with one part of it.

As part of the maintenance, I would like to change a text note, which is pre placed on the starting view.  
The text note should represent date and time of the maintenance and also what happened.

I have tried it in a “normal” opened revit file and it works fine but when I try to do the same on my opened file in the background, I get this error:

_Attempt to modify the model outside of transaction._

 ![22-04-_2021_16-35-09](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/c/ec5a5654495b532e9c972ef143f30d5b306a49c8.png)

any help would be amazing

thanks

---

<div class="post-metadata">

**Author:** ![Jean-Marc](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jean-marc/32/79122_2.png) [@Jean-Marc](https://forum.dynamobim.com/u/Jean-Marc)\
**Post date:** [April 23, 2021, 7:30am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/2 "2021-04-23T07:30:41Z")

</div>

Hi @SpaghettiWithNodes  
Try using the OOTB transaction start/end nodes.

- Transaction start put right after the document opening node
- Transaction End after your setText node
- then save and close the file in background.

If you need more in depth explaination to understand the Transaction drill, try the revit api doc: [Transaction Class](https://www.revitapidocs.com/2015/308ebf8d-d96d-4643-cd1d-34fffcea53fd.htm)

Or easier to understand maybe [Intro to Transactions…](https://danimosite.wordpress.com/2017/05/11/intro-to-transactions/) from @Daniel_Woodcock1

---

<div class="post-metadata">

**Author:** ![Jean-Marc](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jean-marc/32/79122_2.png) [@Jean-Marc](https://forum.dynamobim.com/u/Jean-Marc)\
**Post date:** [April 23, 2021, 7:35am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/3 "2021-04-23T07:35:02Z")

</div>

but if I try to summarize what a transaction is with a metaphor:

- you are in a shop ( **Revit Model** ), you can look around at stuff ( **model elements and data** ) and you can eventually touch and buy things ( **set Text note** for example).
- In order to do so you need to ask the owner/cashier ( **Revit application** ) to interact with the things.
- So you Start talking ( **start a transaction** ), do your stuff/buy, then say goodbye ( **end the transaction** ) and leave ( **save your changes and close the file** )

---

<div class="post-metadata">

**Author:** ![SpaghettiWithNodes](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SpaghettiWithNodes](https://forum.dynamobim.com/u/SpaghettiWithNodes)\
**Post date:** [April 23, 2021, 9:44am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/4 "2021-04-23T09:44:19Z")

</div>

Thanks and also for that great metaphor but it didnt work still the same error.

 ![OpenFileFromRervitServerAndSaveLocal20_2021-04-23_01-02-38](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/2/722e584a8d742e04c3eaf9bc71c7bdb44dfac79e.png)

---

<div class="post-metadata">

**Author:** ![Jean-Marc](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jean-marc/32/79122_2.png) [@Jean-Marc](https://forum.dynamobim.com/u/Jean-Marc)\
**Post date:** [April 23, 2021, 11:49am UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/5 "2021-04-23T11:49:24Z")

</div>

Would you mind sending me your script?  
@SpaghettiWithNodes

---

<div class="post-metadata">

**Author:** ![SpaghettiWithNodes](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SpaghettiWithNodes](https://forum.dynamobim.com/u/SpaghettiWithNodes)\
**Post date:** [April 23, 2021, 12:03pm UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/6 "2021-04-23T12:03:23Z")

</div>

no please have a look i have send you a message

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [April 23, 2021, 12:23pm UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/7 "2021-04-23T12:23:36Z")

</div>

The _TextNote.SetText_ node is not intended to work in a document open in the background.  
Another node should be created with a document input.

---

<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:** [April 23, 2021, 12:31pm UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/8 "2021-04-23T12:31:57Z")

</div>

By not sharing a sample graph you put extra strain on the people trying to help you out, who now have to ‘know’ what the issue is offhand as they have run into it before (Alban likely falls into this category), or to rebuild your graph from scratch which can be quite tedious. Always err on the side of sharing when possible - it helps the community help you which leads to faster answers. 🙂

---

<div class="post-metadata">

**Author:** ![SpaghettiWithNodes](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SpaghettiWithNodes](https://forum.dynamobim.com/u/SpaghettiWithNodes)\
**Post date:** [April 23, 2021, 12:34pm UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/9 "2021-04-23T12:34:31Z")

</div>

sorry

here is my graph

[OpenFileFromRervitServerAndSaveLocal25.dyn](https://forum.dynamobim.com/uploads/short-url/ha13XrsV99xrdngb6DJB7Vm2gDt.dyn) (67.2 KB)

---

<div class="post-metadata">

**Author:** ![SpaghettiWithNodes](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@SpaghettiWithNodes](https://forum.dynamobim.com/u/SpaghettiWithNodes)\
**Post date:** [April 23, 2021, 1:49pm UTC](https://forum.dynamobim.com/t/open-central-file-from-revit-server-in-background-and-change-textnote-text/63206/11 "2021-04-23T13:49:34Z")

</div>

Ok that makes sense to me but I don’t know how to make my own node.  
Is there a Package I could use or do you know how to make a node for this?
