Working with strings (searching and replacing)
Now that we understand how to concatenate strings, let's see how to do more complex operations. First of all, open up Revit, and start a new project file using one of the samples provided by default. If you don't see any, do not worry. You can download the one you like from the following link:
Revit 2020 samples: https://cutt.ly/rmxQloL.
I've downloaded the DACH_sample_project.rvt
file. But again, you can choose whatever you like. Once you download the model, open it inside Revit. If you're using Revit 2021, you need to wait a few minutes to upgrade the model. Then, of course, open Dynamo too. The goal here is to create a script that helps us rename family type names inside our model. And by doing so, we will learn how to split, join, and replace strings along the way.
Also, you may want to download, using the Package Manager, the following package:
- Clockwork
If you don't remember how to...