Room Number (w/ letters) Title Case Formatting through Dynamo

Hello all,
I am working on an existing building which has a varied room numbering throughout. The owner has requested that room number format appears as follows: “X00x”. We previously had all room numbers as upper case, and through a Dynamo script were able to revise all room numbers to lower case. However, the new issue is that some room numbers begin with a letter, and in these cases, we would prefer the starting letter to be uppercase.

In effect, we would like all starting letters to be uppercase, and all following letters to be lowercase. I tried running “To.Titlecase” however, this does not work for rooms such as 3000c, which only have one letter at the end that we would prefer to be lower case.

Please let me know what I can do to solve this, any ideas or tips are greatly appreciated.

Thanks!

Maybe something like this?

1 Like

Thanks for sharing! I am new to Dynamo so please excuse if I am missing some simple logic here.

Is the Dynamo sequence you shared an addition to my dynamo sequence or replacement? What confuses me is that it looks as though the relationship to the Room Numbers is missing along with the “Set Parameter” functions.

Let me know, and thanks for your help!

It is an example.

This is more what your after i think.

The first Node (the Code Block) would be your list of Room Numbers.

Hi @Braeden , Welcome to the forum!
Please try it out from your end, and feel free to reach out if you get stuck anywhere — happy to help!

How to get help on the Dynamo forums - FAQ - Dynamo

If you haven’t started learning Python yet, string manipulation is a great place to start. There are a lot of straightforward methods that are easy to learn. With a little list comprehension, you can get exactly what you need with a single line of code.

Hi Nick,

Thanks for your post, your suggestion led down the right path! I ended up using ChatGPT (I know) to develop the python code. I have attached an image of the solution I was able to get.

Thanks for your help!

Why not use the builtin method?

@Braeden
If your new to Dynamo then i suggest start learning it a bit.

There are non Python solutions for your problem.

You won’t learn much by going straight for
ChatGPT. Just my 2 cents.

1 Like