Change families categories in a batch

Hi,
I tried to change in a project multiple families categories from “Generic Model” category to
“Vertical Circulation” Category - based on this example.

For some reason, its not working.

What am I missing?

See attached pic and Dynamo.

Change Families Categories in a Batch.dyn (16.6 KB)

Thanks!

Hi,

Does your script gives you any errors? It would be useful if you send a screenshot of workflow with preview results pinned.

From my point of view, first Passthrough node is not needed. And also try to add 2 nodes Transaction.Stop, Transaction.Start before the last node.

I Andriy,

Thanks for replaying.
I’m a newbie at Dynamo, so any feedback will be more then great!
After a bit more testing, it worked.

Sharing here my workflow, please let me know if you still think I need to modify the script.

Hi @Reut.H and @Andriy

I am also very new to Dynamo and need to do this exact same task. I tried setting up a script, but it is not working for me.

Could you please share a screenshot of your final working script with the node preview bubbles turned on? Or if possible, could you upload your final .dyn file here? It would be a huge help!

Thank you

This should work. I tested in Revit 2024, if you have Revit 2025 or later you may need to install later versions of packages and additional pack for DynamoIronPython.

@Andriy and @Reut.H ,Thank you for your support! I am using the Orchid package for this script.The issue is that Orchid seems to lock the background family document cache after the first execution, causing an element binding error on the second run.

I tried replacing the 1; code block with a List.Clean node to refresh the data stream before FamilyDocument Close, but it still behaves inconsistently when I run it twice in the same active session.Are you using a specific data-flushing mechanism or a Python transaction wrapper in your version of the graph to clear out the closed background documents?Thank you!

If you run script twice or more, yes, it may be inconsistent. In this case I would recommend closing script before the second run. Or as alternative, use Dynamo Player. I would say it’s the best solution. Just make sure that you make Select model element and Categories dropdown as inputs.

Thank you! I will use Dynamo Player and it works fine. Again, appreciate your support and help!
@Andriy