Dynamo Script Not Changing Floor Names

Hi Dynamo community,

I have trouble with a script that should rename floors containing “FF” to “TL”. The script actually runs without errors, but it doesn’t seem to be making any changes in the Revit file.

I’ve attached a simple Revit file and the Dynamo script I’m usin
Would anyone be willing to take a quick look and see if they can spot what I’m missing?

Any insights or suggestions would be incredibly helpful.

Floor Name Test.dyn (17.8 KB)
Floor Name change.rvt (448 KB)

Can’t quite see exactly what’s going on without seeing the node titles and the node preview bubbles, but it does look like you’re filtering your elements and then assigning values back to the original list rather than the filtered one. That’s where I’d start.

I’m not quite understand your aim. What do you mean under “rename”? Do you want to change Family type name, or Mark, or what exacly? You can’t basicly rename floor instance, because it doesn’t have “Name” property.

1 Like

I assumed you meant Levels but now see that you are in fact selecting Floors as your category. I think that may be your problem.

Your issue is you are trying to rename floors by selecting instances of the floors with the category nodes. You need to work with floor “types” (or “classes” in later versions).

1 Like

I want to change the name of the Floor Types

sorry to not make it clear I want to change the name of the Floor Types
i have fix this now (filtering your elements and then assigning values back )

Floor Name Test.dyn (17.8 KB)

Please have a look how it should work

3 Likes

@Andriy thank you for this work! :folded_hands:
Just a quick question: when should I start working on the category , and when should I begin the classes :blue_book:?

You’re welcome :wink:

Regarding work with classes/categories.

  1. You need first to define whith what you want to work in script - with family instances/elements or with family types. If these are family instances/elements, it is more common to work with Categories.
  2. If you’re working with system categories (walls,floors,ceilings,roofs,ducts,pipes, railings etc), the only way to collect it’s family types, it through Element Classes.
  3. Also, Element Classes contain a lot of specific elements like parameters, print settings, line types, materials etc
3 Likes

You’re amazing — thank you for the tips! :raising_hands::wink:
That really helps clarify the difference between working with Categories and Element Classes in Dynamo.

I’ll definitely be more confident now when deciding how to structure my scripts. Looking forward to exploring more with Dynamo :rocket:

2 Likes

Very well said @Andriy.

2 Likes