Formula - convert number to text

Formula - convert number to text

Anonymous
Not applicable
20,518 Views
13 Replies
Message 1 of 14

Formula - convert number to text

Anonymous
Not applicable

Hey.

I have a family, with the parameter:

Diameter = 8

 

Now i want to use the Diameter parameter in the description, but i get a failure their say's, "Inconsistent Units". Is it in anyway possible to use the number parameters, in a text string??

 

Nichlas

0 Likes
Accepted solutions (1)
20,519 Views
13 Replies
Replies (13)
Message 2 of 14

barthbradley
Consultant
Consultant
Accepted solution

Use a neutralizer. Divide by one or multiply by one.   

 

http://autodesk-revit.blogspot.com/2008/01/neutralize-those-units.html

 

No,  you cannot use a number parameter in a text parameter.  

0 Likes
Message 3 of 14

barthbradley
Consultant
Consultant

...do I win anything, Sport?

 

"Anything I can smoke, drop, shoot, snort, rub into your belly or whatever?" 

                                                                 George Carlin. 1937-2008. May his humor live on.     

 

 

0 Likes
Message 4 of 14

bin
Advisor
Advisor

If you only have a few standard diameter options, you can use if() to make it work.

Something like: if(Diameter = 8 mm, "8", if(Diameter = 10 mm, "10", if(Diameter = 12 mm, "12", "Non Standard")))

Message 5 of 14

RFreund
Advocate
Advocate

I see that you put a strikethrough on the neutralize unit recommendation. 

Is this because it doesn't work anymore or this because it is not recommended. It is odd that you can't do this or that there isn't a function for this. Reason being is that you can get it to work with tags, so somewhere this functionality/formula exists within Revit. 

Message 6 of 14

ToanDN
Consultant
Consultant
What is your formula?
0 Likes
Message 7 of 14

RFreund
Advocate
Advocate

Well I don't really have a specific formula. I was looking for a formula that would convert a length parameter to text. The same way that a Tag can. 

 

For example. Let's say you have various Tile sizes (width x height). You can create a shared parameters for width and height. You can load this family into your project and create a Tag that names each tile instance T(width) x (height). You can also schedule all the tiles and sort them by width and height. However, it would be nice if their Tag name was also in the schedule. I'm unaware of a way to achieve this. One thought would be to make a shared text parameter (or using an existing one, such as description) and somehow converting the width and height dimensions to text and connotate that to the "T". 

 

So if you had a 100mm x 200m tile your Tag and Description would read: T100x200

Message 8 of 14

ToanDN
Consultant
Consultant
A tag doesn't convert anything, you are just putting several parameters and
prefix/suffix in a label. You can do exactly the same using combined
parameters in a schedule. But you cannot do it with a formula.
Message 9 of 14

barthbradley
Consultant
Consultant

@RFreund wrote:

I see that you put a strikethrough on the neutralize unit recommendation. 

Is this because it doesn't work anymore or this because it is not recommended. It is odd that you can't do this or that there isn't a function for this. Reason being is that you can get it to work with tags, so somewhere this functionality/formula exists within Revit. 


 

No, Divide and Multiply are still neutralizers -- they just don't apply in this case. I misread and the OP's post initially.  

Message 10 of 14

RFreund
Advocate
Advocate

Wow, thank you. I just didn't see that icon and didn't know that was an option. 

0 Likes
Message 11 of 14

martijn_pater
Advisor
Advisor

Just fill in the description for the type manually and use that in your tag.

Maybe upvote this idea.  And perhaps also this idea, that could open up some possibilities to do some more things like this with key schedules.

Message 12 of 14

JedSanford
Contributor
Contributor

I know this is old but for future people this can be done with dynamo pretty easily.

Message 13 of 14

PierreHoudeMcLean
Explorer
Explorer

Try this ' My Shared Paramerter is Text, And I wanted to tag my plate  if I chose a plate that had 3 or 4 for holes, so 🙂  if(Top Plate 3 Holes, "3", "4") My parameter of Number of holes changes from 3 to 4 🙂

0 Likes
Message 14 of 14

LucasJonnedeJong
Enthusiast
Enthusiast

You can do it with a LookupTable.  which is basically the same as an if-statement, just simpler to implement if you have many options.  if you have 1000 (or more) options for numbers that you want to turn into a text, just list them in the lookup column, and return the same but as a text from the next column.