Get paramter value by number not string

Hi, I am trying to do a rough system sizing using dynamo, but I cant seem to get the size of the pipes as a number rather than a string so that I can actually use it. So I tried to just think about selecting the maximum sized pipe but even then its not working. If I sort the list I thinks 8" is the maximum. but there are infact 10" and 14" pipes in there. How do i convert these pipe sizes to numbers? Thanks

Hi @mix

Before we answer your questions. Could you please reply to your previous posts mark the posts as solved if it has solved. It helps us keep the forum tidy. Thanks!

3 Likes

all of my question have solutions applied to them. can anyone help me please? thanks in advance!

You could try getting the parameter “Diameter” instead. That will return a double.

1 Like

@mix Try this:

Here is one more approach:

It would be slightly different in imperial because the separator would be the " sign.

1 Like

@viktor_kuzev
Thats an interesting way to go about it. But is there a way to do that using English units easily because, it doesn’t do fractions that way, and IP units have a lot of fractions in our pipe sizes.

@Kulkul,
Im not getting the same results as you. Have you tried having pipes larger that one digit? Here is what I get when I do it your way:

@mix This should would work.

I am not getting mine to work like yours. I am not sure what that lunch box node is supposed to do, but in mine it is pulling in a number, and I think that might be what is messing it up.

@mix watch the lacing for “String.Split” node. You can find all the basics from here http://dynamoprimer.com/en/

Good catch! yeah, Im still bad at remembering lacing. But this sill doesnt seem to work for me, I am getting null values…? and the max size pipe is 14" not 5"

@mix It gives you maximum item in a list. As per your query you need maximum in a list. Look below it shows clearly your looking for maximum item in a list and now your getting it. For other null values questions you should start a new topic.

i am not getting the maximum in the list though. i only mention the null values because I thought they might be throwing off the maximum output. Right now it is not converting my fractional pipe sizes to a number at all so they are being discarded, which I dont want, and the maximum pipe size is actually 6" in this project not 5" like your method suggests it is. Therefore, you graph isnt working to help me find the maximum pipe size. Does that make sense?

And removing the nulls should still be appart of this post because there is no reason any pipe sizes should be returning a value of null. A pipe size cannot be null in revit. Therefore there is a problem with the graph. I suspect that your method is throwing out fractional pipe sizes and not actually converting them to a number. Instead it is making them “null”. Does that make sense? Therefore for example, if my largest pipe size was 2-1/2" in my project, your graph wouldnt see that value at all, and therefore produce a false maximum. Does that make sense?

@mix Is this what your looking?

1 Like