Renaming Nested Families

Hi there,

I’m trying to tidy up our templates and have come across a nested family that my predecessor named poorly. I’d like to rename this nested family but it is in multiple families with the template. can i rename this with dynamo?

Any help would be greatly appreciated.

@joseph.barberV526R if it is a shared family, renaming it in the template is enough, if it is not, you need to background open every family, search for that family, rename it then load the host family to the template, the Orchid package has plenty of nodes to open, edit, load and save families

Hi, is correct to suggest other packages because Dynamo OODB doesn’t allow you to reach the not-shared nested families.

However, not necessarily you have to open the family, apply the changes and then reload it to the project.
The operation can be performed by changing the Family class property “Family.Name” with the desired one. To do so, you just have to open a transaction in the document where the family is stored (that could be a project or a family-document).

At last, I want to thank you for this post because was for me of inspiration for a new post on my blog:
Rename Families and their nested (macro4bim.com)

Here you can find a dynamo node (Macro4BIM package) that does the trick :slight_smile:

1 Like

hi Giuseppe_Dotto, looks like it only works for non-shared nested family, any chance to make it work for shared nested family too? also, Python3 doesn’t work well
image

I guess I avoided editing shared families on purpose as they can be selected from the project. Could you describe the issue you are facing?

Also, this function was written in IronPython. Calling the attribute ‘Parameter’ in CPython is not possible and you should instead use ‘get_Parameter()’. If you describe the issue, I can take care of updating this node and republish for the R23 (CPython) version.

‘get_Parameter()’ works great, thanks.
in your Python code, i set shared parameter to 1 or simply commented out, seems renaming not successful


my case is simple, just rename nested shared family i.e. from ‘OMI-Furniture-ChairDesk-Standard’ to ‘k_OMI-Furniture-ChairDesk-Standard’
shared test.rvt (716 KB)

Thanks for the clear explanation and also for the test file!

I looked at the code and updated it to work with CPython. Please find the new node in the updated version of Macro4BIM.

FYI: As you can see, the output list is now different and contains a last port, “Shared_Renamed”. This is because I still let the script recognize if it’s dealing with a shared family, and in this case, it will rename the family both in the family where it is nested and in the Revit main project.

3 Likes

works great! thanks Giuseppe_Dotto