Naming scheme from parameters

Hi everyone, I am new to pyRevit and was wondering if it would possible to implement an automatic naming scheme for family types.

I have a lot of family types that are based of width and height like windows for example. I’d like to be able to set variables when naming the family type as “type-parameter:width” x “type-parameter:height” and then once I input those parameters in the family and create duplicates it would automatically rename it.

Would be great if that could be variable based and not an additional script that has to be ran afterwards manually…

I saw on revit forums someone that suggested the idea back in 2022, but could be a great avenue. Here’s the link to the original post.

Thanks!

Yes, of course.

It sounds like you want to have the user make a new family. Set the correct dimensions or other information. And then have it renamed based on that information.

If that is the case, you would want to set up an iUpdater with the DocumentChanged event. From there is it pretty normal Revit API. I don’t think you could use the ElementTypeDuplicate event,. I think that is going to fire before you have all the information you need.

But you might want to run this less frequently and run it on a DocumentSaving event.