Revit Parameters If Statement with Text Parameters

Revit Parameters If Statement with Text Parameters

dan.buckingham
Participant Participant
6,611 Views
14 Replies
Message 1 of 15

Revit Parameters If Statement with Text Parameters

dan.buckingham
Participant
Participant

Hi, I'm looking for a way to create a label within a titleblock family that is dependant on another shared parameter's value.

 

Example:

-If the parameter A (text) equals A1, then parameter B (text) is to equal Issued for Co-ordination

-If the parameter A (text) equals B2, then parameter B (text) is to equal Issued for Information

etc

 

This is surely a very basic functionality that must be incorporated into the software, I just can't seem to get it to behave.

I keep getting faced with "Improper use of boolean expressions", which I find ironic as I'm starting to think Revit doesn't know the proper use of boolean expressions...

danbuckingham_0-1683039903697.png

 

0 Likes
6,612 Views
14 Replies
Replies (14)
Message 2 of 15

ToanDN
Consultant
Consultant

A text parameter cannot drive a formula.  Instead, use an Integer parameter to drive both of the text parameters.

0 Likes
Message 3 of 15

dan.buckingham
Participant
Participant

I find this lack of such a basic and integral feature surprising and somewhat concerning!

 

OK then, if we accept this huge limitation, can you please advise on how I should solve my particular issue:

I'm working with an inherited model, so hence I have a few restrictions. At present, my users have to check a tickbox on the titleblock to assign a Sheet Status (A1, S2, etc) to said sheet. They also are having to input the Sheet Status into a separate parameter on the sheet itself in order for a Plugin (DiRoots ProSheets) to automate the file naming.

 

I'm looking at a way to streamline this process, and allow multiple sheet status' to be assigned at once through schedules etc as this isn't possible directly to the titleblocks as far as I'm aware (Revit 2020).

 

My initial approach was to get the Sheet Status (sheet) parameter to report in the titleblock as a label, which works perfectly. However, along with the Status Code, there is a desire to have a description reported with the code (A1 - Issued for Co-ordination). Therefore I wanted the contents of the Sheet Status parameter to dictate the contents of the Sheet Status Description parameter.

 

In asking this, I realise I could just have the full code + description in the Sheet Status parameter as a drop down, which would all get reported in the titleblock, but I'd like to be able to control font size etc separately.

Message 4 of 15

alfmedina
Contributor
Contributor

Maybe your users can enter the sheet status in an integer parameter. 1 means this, 2 means that (A1, S2, etc..). Then, with an integer value you can do IF formulas and they will work.

0 Likes
Message 5 of 15

dan.buckingham
Participant
Participant

Thanks, I think that will solve the Sheet controlling Titleblock aspect of the issue. As a note I've also managed to get it to work with Yes/No checkboxes within the sheet itself.

 

However, this still leaves me with the problem of the Sheet Status text parameter used for the DiRoots Prosheets plugin. Essentially this plug in allows you to form file names by queuing up parameters, hence the creation of the Sheet Status parameter.

 

So the second part of the question is: outside of a family, is there a way of getting a Sheet parameter to respond to another sheet parameter? For example, if I have an A1 Status checkbox on the sheet, is there a way of populating a Sheet Parameter with the text A1, similar to how I've gotten the titleblock to work?

0 Likes
Message 6 of 15

ToanDN
Consultant
Consultant

A1 Status is a visibility parameter

A1 Text is a text parameter

Use this formula for A1 text:  if (A1 Status, "enter your text here", " ")

 

 

0 Likes
Message 7 of 15

alfmedina
Contributor
Contributor

Yes, in that case you do something like this, in the formula of a text parameter, asuming that Status A1 is a yes/no parameter: 

if(Status A1, "A1", "None")

0 Likes
Message 8 of 15

dan.buckingham
Participant
Participant

Yes that is how I got it to work in the Titleblock family, but I'm wondering if there is a way that a similar thing can be done in the Sheet itself, outside of the family, so that my users can continue to use the DiRoots plugin to automate file naming

0 Likes
Message 9 of 15

alfmedina
Contributor
Contributor

Will it help if you do a sheet list schedule? You include the yes/no parameter, then use Calculated values, as text, with a formula to create text values based on the status of the yes/no parameter. Can you export or connect from there to your DiRoots plugin?

0 Likes
Message 10 of 15

dan.buckingham
Participant
Participant

Ah I never thought about calculated parameters from schedules, that might just work!

I’ll test it tomorrow in the office (U.K. time zone) and accept solution if it works.

0 Likes
Message 11 of 15

HVAC-Novice
Advisor
Advisor

I think I understand what you want. Having a literal text, that a user has to enter, drive a function would be hard to do since there is a good chance a user doesn't know the syntax, or fat-fingers the exact term or uses different capitalization. So if the options are "A1", A2"and so on. Many users will enter "a1", or not know to enter "A1". it always should be intuitive what to select without having to reference the "secret code book". 

 

A drop-down (where you pre-define the exact options) would be better. Then they see and only can select the exact options you wanted them to choose from. 

 

Unfortunately, a dropdown isn't a simple feature in Revit. if you search the ideas forum, there seem to be some requests asking for such feature to be added. 

 

https://forums.autodesk.com/t5/revit-ideas/dropdown-lists-for-parameters-comboboxes/idi-p/6315262

 

Here one not for your specific problem, but also a useful one (IMHO)

 

https://forums.autodesk.com/t5/revit-ideas/concatenation-of-parameters-within-families/idi-p/6339606

Revit Version: R2026.2
Hardware: i9 14900K, 64GB, Nvidia RTX 2000 Ada 16GB
Add-ins: ElumTools; Ripple-HVAC; ElectroBIM; Qbitec
0 Likes
Message 12 of 15

dan.buckingham
Participant
Participant

I can completely understand your reservations, but in my particular situation I'm working with a very small team (4) so it's not much of an issue to brief everyone, plus they are status codes we have been using for years. My understanding is that if the code has been used elsewhere in the project, it is available as an option on the drop down? In which case, I'm happy to have a few "dummy" sheets with the codes loaded in so they can be selected as a workaround.

 

I have developed my approach further, and come up against another issue highlighted in this thread:
https://forums.autodesk.com/t5/revit-architecture-forum/project-parameters-dependent-on-other-projec...

0 Likes
Message 13 of 15

dan.buckingham
Participant
Participant

I tried the sheet list and calculated parameter, which worked great to populate a field with the required value

danbuckingham_0-1683103726597.png

However the next stumbling block is that this Calculated parameter doesn't count as a project parameter, so cannot be included in the plugin.

danbuckingham_1-1683103906256.png

Any suggestions? I'm feeling like I might be fighting a losing battle at this point.

 

0 Likes
Message 14 of 15

timlove
Advocate
Advocate

I share the frustration of not being able to use text in formulas, but it is what it is and we move on and find solutions.

 

Dynamo has come in really handy to small repetitive things like that to me.   This will get really messy if you have a lot of check boxes.  And I realized I built it a bit backwards, you would want it to check for the newest release first, if that is not checked move onto the next.   I did oldest to newest in the attached file.

I would make whatever the text parameter you are using into a shared parameter, just so you can work with it in more ways. 

0 Likes
Message 15 of 15

dan.buckingham
Participant
Participant

Hi Tim, this is very useful, thanks!
I've come to accept the limitation, and have now decided to proceed with checkboxes in the sheet for status (reported as a label with a mountain of IF statements in the titleblock), and a separate text parameter in the sheet for the plugin. It's not the most elegant solution, but it works within my small team.

 

I did consider creating a dynamo script that sets the parameter value according to the tiockbox, but since I don't believe scripts can be passive (instead requiring a button etc to be pressed to run) then I'm introducing another step to the workflow, so I might as well just stick with the manual input that I already have.

 

Thanks for everyone's input, hopefully Autodesk can listen to feedback!

0 Likes