Associating Parameters in Documents Opened in Background


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.

@erfajo

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.

This worked, thank you so much!