Harmless Warning

Is there a way to turn off such harmless warnings?

What are you giving to the str input?

A bunch of numbers and letters with “string” as data type.
I am filtering out numbers from letters.

hi @theshysnail,

try this to_number.dyn (3.4 KB)

a

or this to_number 2.dyn (3.4 KB)

b

1 Like

With ootb nodes, you should first check the type (object.type) and then filtering strings from others. So you will not have the warning.

All input data is of string type.

Some design script nesting the function in an if statement should do the trick:

String.ToNumber(str) != null ? 
    String.ToNumber(str) : 
    str;
2 Likes

Am I doing this wrong?

Hmmmm… no I may be accounting for this backwards. Will check soon.

Sure. Always looking for OOTB methods. :slight_smile:

Method 1: Use a function.

Method 2: Design Script.


(I’m in Dynamo Sandbox 2.8 here, and can’t surface the warning. Not sure if bug or feature… :thinking: )

Method 3: Design Script if statement.
image
This won’t always work, but has had good success for me.

3 Likes

Thanks. The first method works for me.

(I’m in Dynamo Sandbox 2.8 here, and can’t surface the warning. Not sure if bug or feature… :thinking: )

In Dynamo 2.6.1 (Revit 2021.1), it gives a warning to me.