Running Node on Several Background Opened Files


In conjunction with the background open and close nodes, I modified the code for the “Set Active Family Parameter By Name” node to allow for document input. It seems to work fine as long as there is only one file being opened in the background. I get a “null” from the Set Parameter node when there are multiple files open. I am not that knowledge savvy with python, just enough to get by on some things, so I am not sure if what I changed is correct or not. Any help with the coding and setting the script and/or the Set Active Family Parameter node to work with multiple files, would be greatly appreciated. See below and attached.

File and Parameter Updater.dyn (8.0 KB)



@staylor You have to iterate over your list of documents using a for loop. Right now you are defining doc as a list, so essentially in line 18 you are saying param_list = ListObject.FamilyManager.GetParameters() See below example, when I query the object type of the input without a for loop, it shows me the object is a list. If I query the object type of the input elements with the for loop, it returns the object type of the items in the list

So, you need to put your code within a for loop that is iterating over the list of documents, that way the code is running through each input document. Hope this helps you in the right direction :slight_smile: (Side note, there is a node in the package “DanEDU Dynamo” that does exactly what you are trying to do, so you won’t have to end up editing any Python if you get that package)

1 Like

Python Nodes Basics

Thanks Amy. I tried editing the code for self improvement towards learning Python. I did end up using the node from DanEDU. Thanks again!