i have a list from where i want to gather the Level.Name, unfortunately some elements return an empty value.
I would like to avoid the error so basically replace the empty index with something like “not available” while the other returns the level name… while not returning an error.
@Daniel_Hurtubise - can you post the preview of the node feeding into that and a preview of where you are selecting your levels? I can’t envision a situation where this would return anything other than the level name.
If you want to clear out empty strings you can also avoid the python and get around the solution with a variation of this in a code block:
This seem to be working with String but passing on a list of elements wont add the string to the list.
Is it because the lsit needs to stay the same object type?
Morning @JacobSmall. They are not string, they are Levels from which i want to get the LevelName
l6 = l0.GetParameterValueByName(“Level”);
l7 = l6.Name;
@Daniel_Hurtubise - do your selected elements not have a level parameter?
They are all the same families (generic modesl)
Think I’d need a rvt to find out why this is happening, and how to resolve it.
At least this time i get null instead of an empty index ![image|663x444]
From there i can replace the nulls but it would be nice if the python node could do it
This last script i wrote will replace all items that do not have “Level” in the name. So it will work with both the blank items and the nulls.