Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

If statements for text parameters

34 REPLIES 34
Reply
Message 1 of 35
Keith_Wilkinson
26818 Views, 34 Replies

If statements for text parameters

As far as I know this can't be done.  But for the life of me I can see no reason it can't be made to work.

 

I have a window schedule that automatically calcualtes the area of trickle vent required.  However if the room is mechanically vented no trickle vent is required.

 

Now, if I control the ventilation type using an Integer Parameter I can do two things, 1) I can use a formula to fill in the ventilation type, e.g. 1=Natural, 2=Assisted, etc and this shows in a column in the schedule, and 2) I can use an if statement to return a Null value for the trickle vent calc.

 

That's fine to a point, but it requires the user to know what each of the values means and that isn't ideal.

 

What I really want is to cut out the integer field and get the Trickle Vent parameter to return a null simply based on the ventilation name...

 

eg If(VentType="Mechanical", 0, TrickleVentArea)

 

why doesn't Revit allow this to happen?



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
34 REPLIES 34
Message 2 of 35
CoreyDaun
in reply to: Keith_Wilkinson

Revit's formulaic capabilities are extremely limited. Revit cannot concatenate [combine] strings, cannot use text data in a conditional statement, and cannot convert other data types to text strings.

 

In this case, here, I think you will need to have a Yes/No Parameter for "Mechanically Ventilated", which can then be references by "Trickle Vent Area" are return 0. Revit is not capable of returning a null value, unless it's a Text Parameter. The best you can do to nullify a cell is to create Conditional Formatting for that field to display a solid black fill under the desired conditions, and have that formatting shown on the sheets. Note that this cannot be done in versions prior to 2014.

Corey D.                                                                                                                  ADSK_Logo_EE_2013.png    AutoCAD 2014 User  Revit 2014 User
──────────────────────────────────────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate to further enhance these forums. Thank you!
Message 3 of 35
Keith_Wilkinson
in reply to: CoreyDaun

Thanks Corey,

 

I guess the post is as much a minor rant as a question, perhaps in the vain hope that AD might actually read it and improve things.  It's frustrating that you have data there but cannot manipulate it in the the way that is required.

 

I did consider the Yes/No option but I've actually got 3 options (Natural, Assisted and Mechanical) and there is no way that I know of to do a 3-way switch so that only one can be selected at any one time.

 

I will look at the conditional formating field option - I can't do it in this project as it's running in 2013 but we are gradually moving new jobs onto 2015 so I can test it there.

 

thanks as always for your input it's much appreciated.

 

Cheers

 

K.



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 4 of 35

It would also be handy if you could just have Revit return a hypen instead of a numeric value... again this is largely a visual thing but it would make our schedule much easier to read...



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 5 of 35

Hello:

 

I am not sure if folks are still checking this post. But I thought I would chime in with a few options. First off, I completely agree with Corey and would love to have concatination, etc. So please Autodesk, consider that on the wish list!

 

OK, as to having a 3-way checkbox. Checkboxes are yes/no, but you can use AND, OR and NOT in your IF statements to allow for more possibilities. So in the original poster's case, it might look like this:

 

Have three yes/no paramters for: Natural, Assisted and Mechanical

 

You can make it so that these are independent, or you can write a formula for Natural like: NOT(Mechanical) 

 

Or something more complex like: NOT(OR(Mechanical,Assisted))

 

In the first case, the NOT statement will check or uncheck the "Natural" parameter automatically based on the setting of Mechanical. If Mecahnical is checked, Natrual is unchecked, and vice-versa. In the second case, in order for Natural to be checked, neither Mechanical nor Assisted can be checked. 

 

You can continue to combine these in a variety of ways. AND would require all of the values listed to be checked: AND(A,B,C) means that to be checked, three other parameters called: A, B and C would have to be checked. 

 

So, if you can find a good way to combine the checkboxes, then it is possible to get back to the formula you wanted. In the screen shot attached, I worked up a quick example. But naturally I am not familiar with all of the rules for your particular situation, so you might need to adjust it.

 

 

 

This works OK, but what we really need is a concatenation as mentioned before and... a LIST parameter. That would make me really happy. 🙂

 

I do have a pseudo-list solution that I have used on occasion, but it is pretty complex and can be fragile. I can come back later when I have a few minutes and post an example if anyone is interested. 

 

Hope this helps. 

paul

Paul F. Aubin




Paul F. Aubin Consulting Services, Inc.
Check out my books and training videos
paulaubin.com
Message 6 of 35

Thanks for taking the time to look at this Paul,  I hadn't considered using an OR statement but will play around with it and see what I can come up with based on your example.

 

LIST statements would be extremely useful and would end a lot of the headaches I'm currently suffering with scheduling.  An example is a field that ultimately will be a Yes/No parameter but during design development needs to be labelled as TBC.

 

It would be interesting too to see your pseudo list option...  ;o)

 

Cheers

 

K.

 

 



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 7 of 35

Hi Keith:

 

I am thinking of doing it as a class at AU or RTC one of these days. But I'll try to do a write-up here in the next day or so. The idea uses the <FamilyTypes> parameter. This makes a list. So the idea is to nest in something that is in a category you are not using for other things. This way you don't end up with other stuff on the list that you don't want. Once you get the list, you can build formulas from it. There are other nuances as well, like hiding the parameters you don't want users to see, etc. 

 

Like I said, I'll try to find a few moments and work up a tutorial. (But my AU papers are due soon, so I should probably work on those first... 😉

 

Hope that helps. 

paul

Paul F. Aubin




Paul F. Aubin Consulting Services, Inc.
Check out my books and training videos
paulaubin.com
Message 8 of 35

Thanks Paul,

 

No rush from my end, would be nice to see when you have time.  Might have a little dabble in the meantime...

 

cheers

 

K.



"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 9 of 35

These parameters are yes/ no and not actually TEXT right?

 

I want to edit my wire sizes, but this is currently unavailable. 

 

I want to create a work around..

 

1. create a text parameter and called it schedule note 1. and replace electrical circuit parameter "wire size" with "schedule note 1"

2. use a calculated value to call in revits "wire size" parameter if Schedule note 1. is blank.

 

If you think i should create a new post please let me know.

 

Thanks,

Bmill

Message 10 of 35

Has then been modified in later versions?  Can a conditional statement analyze a text parameter?

Message 11 of 35

No.

Message 12 of 35
Mario_LeRoux
in reply to: ToanDN

Please Please Please. Can Autodesk look into getting the text capabilities to work in Family equations. I have a case where I have 25 types of symbol all with a text based name nested. I would love to be able to just type in the name and get the correct symbol. But now I have to link each Text name to a Integer and then link that to a yes/no switch. 

To make things even more complex I have up to 7 sub shapes of some of the main shapes. This becomes extremely cumbersome to use and manage.

 

All would be so much better with the ability to use a IF (Text,yes,no) command.

Message 13 of 35

Agreed, the 'I' in BIM is largely lacking regarding flexibility and adaptability with Autodesk...

Currently trying to set up Area accommodation schedules for the office as part of our standards, and as a simple example, want to automatically get the schedule to fill in how may cycle parks one needs for 1 Bed, 2 Bed etc. Unfortunately, the '1 Bed' is text format....in Excel, this would be simple.
Feel like the salmon swimming upstream, trying to convince the office that Revit is the way to go....

 

and don't get me started having to add separate parameter to circumvent not being able to use the Count parameter to work out percentages...

Message 14 of 35
RDAOU
in reply to: Lars_Jeppesen

Someone finally woke up the sleeping Giant! Keith! 

 

2014...I think this post is as old as Dynamo! Autodesk will never realize that some of their customer base are quite demanding and hard to satisfy. The thing about this post in particular is that defining dictionaries for text parameters in Revit (to be able to use them in formulas) is what got me to learn Dynamo and coding lol

 

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 15 of 35

Just got notified that there was activity on this post. Boy it's been a while. I am also a little embarrassed to realize that I said I would come back and post about list parameter work arounds, but never did. For anyone following this post who was looking for that, please accept my apologies. 

I have written about that in a conference paper that is posted on my website. You can visit my website and download the PDF here. Once there, click the link for the session named: Revit Family Editor – Beyond the Basics. There are many tips in that paper, but the part about using <Family Types> parameters as a drop-down list starts about page 50. 

However, back to the original post here. This post started way before Dynamo. But now that Dynamo is a part of Revit, this presents another option and potential solution. You can use Dynamo to concatenate and evaluate string-based (text) parameters and then update Revit values as required. So this is another option to consider.  

paul

Paul F. Aubin




Paul F. Aubin Consulting Services, Inc.
Check out my books and training videos
paulaubin.com
Message 16 of 35
RDAOU
in reply to: Paul_F_Aubin

I thought Dynamo came into the picture sometime in 2013/2014 or was that when the team was put together...it was definitely there in 2015 ...idk! It's been a long time

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 17 of 35

Right around that time for sure. I suppose I should have said that back when the original question was posed, Dynamo was not an obvious solution, but these days it certainly could be. 

paul

Paul F. Aubin




Paul F. Aubin Consulting Services, Inc.
Check out my books and training videos
paulaubin.com
Message 18 of 35
Keith_Wilkinson
in reply to: RDAOU

I think Autodesk are starting to better understand the needs of customers... so many little enhancements in 2022...

I'm hopeful that maybe one day soon the family editor will come within firing range and some of these niggles can get ironed out. Personally for me, in a busy work environment, I'm not sure Dynamo is a terribly practical solution to this particular issue and it's still one I'd like to see something happen with...


"Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
Maimonides
Message 19 of 35

Agreed. I don't like Dynamo for things that need to be performed repeatedly. 

paul

Paul F. Aubin




Paul F. Aubin Consulting Services, Inc.
Check out my books and training videos
paulaubin.com
Message 20 of 35

Autodesk, please add the ability to use text parameters in if statements. We've been waiting 8 years.

 

I came across this issue updating our titlesheets. I'd like to use the BIM suitability code (e.g. 'S2') in an if statement to set the visibility of a description of that code (e.g. 'for information'). I know there are workarounds using integers or setting the booleans directly (we've just changed from the latter to the former), but all have disadvantages that being able to use text in an if statement would avoid.

 

P.S. Does this thread being marked as solved make Autodesk less likely to address it, because so far there's only a workaround, not a solution?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report


Autodesk Design & Make Report