Open revit file in background and change data inside models - error in python script

Hi everybody
I’m trying to develop scripts that work with revit files in background. I’m using rhythm nodes (Application.OpeNDocument) to open revit files in background by filepaths. I aim to access to the data of models (and I can do it actually) and change it, but when I create a “for loop” in a python script inside dynamo to start the transaction, or I use a node that change parameters values, I obtain this error with unsuccesful result:

Anybody knows if it is impossible to change data outside Revit model? Or there is another way to bypass the obstacle?

Thanks

Hi @a.remigio,

You could use the SetParameterByName in Document node from the Genius Loci package.
The node works for documents opened in the background. However, the node is far from perfect and you must not forget to save the document once the modifications have been made.

1 Like