Forums
Forums >> Revit Building >> Technical Support >> String Values in Formulas
|
|
active
Joined: Fri, Apr 8, 2005
1 Posts No Rating |
I am familiar with programming but new to Revit. The short: Regarding formulas, are text parameter (string value) tests allowed in conditional statements? The long: I have a room schedule and I have created a Calculated Value. In the Formula field I am using a conditional IF to test the values of other parameters. I would like to test the string value from one of the text parameters. A simplified version is this: IF (Occupancy = "Grade 3", Area/50, Area/40) With this however I get a message that says: "Improper use of boolean expressions". If I use: IF (Area > 600, Area/50, Area/40) It works. However the second formula is not the calculation I wish to make, I just used it to test that the issue was with the string expression. Any help is appreciated!
|
This user is offline |
|
|
|
active
Joined: Sun, Apr 25, 2004
1207 Posts
|
You cannot use text in formula evaluations. If you are evaluting occupancy then you have to take a more sophiscated approach using Schedule Keys to develop a room or area style and then apply that Schedule Key to the room or area. More in-depth than I can cover in a post. There are some posts out on www.augi.com that do cover this in some detail. I think a few that I have even contributed to.
-----------------------------------
Tom www.reviteer.com http://twitter.com/Reviteer |
This user is offline |
View Website
|
|
active
Joined: Wed, May 16, 2007
3 Posts No Rating |
Further Question on these formulas...
I understand the formula when it relates to an integer and I am able to input the correct formula to create a check between occupancy, load factor, and exits etc.
However, I would like to apply the same type of check into my Room Finish schedule and check between the Wall, Ceiling, Base, and Floor Finishes in the Schedule VS the Room Finish Tag.
So, in short, I have created Shared Parameters called Wall Finish Tag, Ceiling Finish Tag... which are Text Parameters (since we simply enter in the text of each material/finish into the room properties). I get the Boolean Expression error when I create the formula if(Wall Finish=Wall Finish Tag,1,0). Is this type of formula possible, or can it only work with Integers/Area etc?
Any suggestions on how to make this kind of check work?!
Thank you!!
|
This user is offline |
|
|
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
|
As Tom stated many years ago: " You cannot use text in formula evaluations." Still can't use text in conditional statements.
|
This user is offline |
|
|
active
Joined: Wed, May 16, 2007
3 Posts No Rating |
Fair enough. Is there any way to create the right type of parameter that will allow this check?
What if they were Material/Finish types? I REALLY want this to work!
|
This user is offline |
|
|
site moderator|||
Joined: Tue, May 16, 2006
13079 Posts
|
Sure, don't use text, use numbers!
That doesn't work for you, does it? Revit does a lot but it doesn't do everything everybody wants.
You will need to check this manually as you always did in CAD or use the other tools provided by Revit. Export your schedule to a txt file, open that with excel and put your formula there. <<< DON'T COME BACK AND SAY YOU WANT IT IN REVIT BECAUSE YOU CAN'T
|
This user is offline |
|
|
active
Joined: Wed, May 16, 2007
3 Posts No Rating |
Hahahaha well it was worth a shot!
I suppose the best way to show this is keep the parameters as text, and keep the 'Tag' parameters in the schedule to compare. I was hoping to provide conditional formatting, but I understand that this is impossible.
thanks for the help. I really appreciate it!
|
This user is offline |
|
|
active
Joined: Mon, Mar 15, 2010
199 Posts
|
Here is a workaround I use.
http://plevit1.blogspot.kr/2013/12/text-string-value-in-formula.html
-----------------------------------
want more?
You can get more tips at Enjoy Revit |
This user is offline |
View Website
|
|
|
Similar Threads |
Parameter formulas losing calculated values |
Revit Systems >> Technical Support
|
Wed, Jun 17, 2015 at 2:23:19 PM
|
1
|
Current date in formula on titleblock |
Revit Building >> Technical Support
|
Mon, Oct 8, 2012 at 10:03:30 AM
|
0
|
Understanding Formulas |
Revit Building >> Technical Support
|
Tue, Nov 16, 2010 at 1:36:05 PM
|
14
|
Creating Dimensions with english and metric dimesnions on one string |
Revit Building >> Technical Support
|
Wed, Aug 26, 2009 at 7:15:58 AM
|
5
|
Preloaded Size Values in Revit MEP |
General Discussion >> Revit Project Management
|
Tue, Aug 24, 2010 at 1:54:48 PM
|
3
|
|
|
Site Stats
Members: | 2056525 | Objects: | 23074 | Forum Posts: | 152325 | Job Listings: | 3 |
|