Export a Revit BOM to Excel via dynamo when the number of characters exceeds 31

I want to export my Revit BOMs to Excel using a dynamo.
The problem is that when the nomenclature exceeds 31 characters it goes to “null” and the sheet is not exported (Revit limit)
Does anyone know of a knot that can reduce or limit the number to 31 characters.
I tried with the node below, but it works only for nomenclature greater than 31 characters (By connecting the block code to “startindex” I create a condition less than 61 (I took a little margin) but it crashes for nomenclatures smaller than 31 characters.


I think you should write (maybe) a condition in a bock code, but I don’t know how to do it.
Someone would have any idea ?
thank you in advance

Which nomenclature? What node causes the crash?

In this example, I have selected 3 nomenclatures


Ah! Schedule names. Twas a translation issue.
This will make short work of the issue:

Hello and thank you for this answer, but it does not work for the simple reason that if I have a list of characters that vary from 19 to 50 (see example)
and that a character chain is lower than the interval, it crashes.

You need an if node to set the length.

The test is String Length < 31.
Value if true is the string length.
Value if false is 31.

Thanks, but I don’t know how to connect them. Can you guide me?
Thank you

This does not work because when I leave “IF”, I have text and not numbers. So I can’t connect to the “lengh” of String.substring.
Another solution ? Thank you


I think this will solve your problem.

Great !
Thanks for your help.
It works !!

1 Like