# Associating Parameters in Documents Opened in Background

**URL:** <https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788>\
**Category:** Revit\
**Created:** [May 10, 2021, 3:59pm UTC](https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788 "2021-05-10T15:59:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cagnewHE4DX](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@cagnewHE4DX](https://forum.dynamobim.com/u/cagnewHE4DX)\
**Post date:** [May 10, 2021, 3:59pm UTC](https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788/1 "2021-05-10T15:59:13Z")

</div>

![dyn](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/1/21cd6664b81bfe304005795c11e079178f3b203b.png)  
Help, using this script to take a mechanical equipment family, will need to run this on a folder containing many families once I get this working, and add some electrical parameters and then associate some of those parameters to an electrical connector. Everything works just fine when I use the “Document Current” node and have the family open but as soon as I try to run the script opening the document in the background how I have it set up in the screenshot I get an error. Disregard the error on the SharedParameter.Add node I’m not sure why it gives me and error because that one still work correctly. I am not sure what the error on the Parameter.Associate node means, I am new to this. I am assuming it is a “sub-transaction” because the family is open in the background and not the current open document in revit but I am not sure; either way I’m hoping someone can help me resolve the issue.

---

<div class="post-metadata">

**Author:** ![cagnewHE4DX](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@cagnewHE4DX](https://forum.dynamobim.com/u/cagnewHE4DX)\
**Post date:** [May 12, 2021, 9:53pm UTC](https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788/2 "2021-05-12T21:53:29Z")

</div>

@erfajo

---

<div class="post-metadata">

**Author:** ![Hamish](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hamish](https://forum.dynamobim.com/u/Hamish)\
**Post date:** [May 13, 2021, 3:16am UTC](https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788/3 "2021-05-13T03:16:16Z")

</div>

Guessing a little bit here, but try a transaction.End node before your familyDocument input into the Parameter.Associate node. They may need to happen as separate operations.

---

<div class="post-metadata">

**Author:** ![cagnewHE4DX](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@cagnewHE4DX](https://forum.dynamobim.com/u/cagnewHE4DX)\
**Post date:** [May 13, 2021, 3:42pm UTC](https://forum.dynamobim.com/t/associating-parameters-in-documents-opened-in-background/63788/4 "2021-05-13T15:42:07Z")

</div>

This worked, thank you so much!
