Modify The Family Name

I need to modify the names of my furniture families. Each furniture family corresponds to one room. For example, my furniture family name is currently ‘BNY_MMD_SS_1’, and the room number is ‘33 23 65’. The result should be ‘BNY_MMD_SS_33 23 65’. FYI



Screenshot 2024-04-15 230031

It’s doing exactly what you asked it to do: concatenating the room number to the original name. If you want to replace the family number with the room number then use String.Replace instead.

String.replace is not working, I need to rename more than 500 families.

That’s because you’re feeding it a multi-line string instead of three individual string values. But what you really want to do is replace the family suffix with the actual room number instead of concatenating.

Replace with family suffix with the actual room number.

Hi @Vivek_Manika_Sudhars try replace multiple from clockwork…

1 Like

I don’t think you even need to replace multiple values (in the same string). You have 3 families for 3 rooms, a 1-to-1 relationship, so all you need to do use replace the suffix with the room number.

In fact, you don’t even need to know the family suffix if you get the family directly from the room. You know the family name is supposed to be "BNY_MMD_SS_"+[RoomNumber] so just make it that.

2 Likes

Hi @Nick_Boyts and @sovitek
I wanted to express my gratitude to both of you for your assistance. Thanks to your help, my script now works perfectly. However, I’ve encountered another issue: the room numbers and family numbers do not match up.

Could you please provide guidance on how to resolve this discrepancy?


Dynamo Test.rvt (7.3 MB)
Test Family name to change-1.dyn (29.6 KB)

hi @Vivek_Manika_Sudhars something here maybe…

2 Likes

To be honest this is bad practice in my opinion. Why not as the Room Number as an Instance Parameter?I ask this just out of curiosity.Maybe i am missing something?

1 Like

Hi @sovitek

I am encountering an issue with my architecture model, which is linked to the interior model. I am unable to read my room numbers.

allright not sure about that…:wink: do you have some small samples of these link :wink: :wink: