What Formula do i use to add yes/no values

What Formula do i use to add yes/no values

Daniel_Hinks
Enthusiast Enthusiast
740 Views
4 Replies
Message 1 of 5

What Formula do i use to add yes/no values

Daniel_Hinks
Enthusiast
Enthusiast

In my family, i have a list of 37 parameters that are all driven by visibility - yes/no

I want to create a data parameter which has a formula to total up the amount of these 37 parameters that have been ticked 'Yes'. Also, for some of those 37 parameters i would like it to be worth more than 1, i.e. one parameter may be worth 1, another may be worth 3.

So as an example of the 37 parameters that have been ticked, 10 may be ticked in total,

7 are worth 1

2 are worth 2

1 is worth 5.

So, in my data parameter, i want a formula which will look at all 37 parameters, identify that 27 have not been ticked and are a 'no', therefore not adding anything to the total, then the other 10 should be picked up by the formula for being ticked, and the total in this instance should be 16.

 

My total is out of 100, so i'm then hoping i can add 100 individual totals 1-100, and then i can drive the visibility of these items in the project to only show as visible if they're value is equal to the data parameter, and the other 99 remain turned off.

 

0 Likes
Accepted solutions (1)
741 Views
4 Replies
Replies (4)
Message 2 of 5

L.Maas
Mentor
Mentor
Accepted solution

Something like this:

Revit Parameter YesNo Count.png

Better to build the formula in something like notepad (better overview and copy/paste) and then copy it to Revit

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

0 Likes
Message 3 of 5

Daniel_Hinks
Enthusiast
Enthusiast

Hi,

Thanks very much... this looks to be working OK - My formula is going to get pretty long - see below... i'm only about 1/3 of the way through.... it just seems to crash my revit program when i input this formula... it's OK for the first few "if" strings. I'm going to try and break it down add the formula in gradually to see which point it breaks down now.

 

Also, as a side question - I am struggling to add a label which will give me this total from this formula on my title block. I have added the formula but it doesn't seem to read the value. I have tested it with the standard parameters such as the sheet number and this comes in succesfully.

 

if(BB_CDM Falls From Height L,1,0) + if(BB_CDM Falls From Height M,2,0) + if(BB_CDM Falls From Height H,3,0) + if(BB_CDM Hazardous Material L,1,0) + if(BB_CDM Hazardous Material M,2,0) + if(BB_CDM Hazardous Material H,3,0) + if(BB_CDM Excavation_Service Strike L,1,0) + if(BB_CDM Excavation_Service Strike M,2,0) + if(BB_CDM Excavation_Service Strike H,3,0) + if(BB_CDM HAVS L,1,0) + if(BB_CDM HAVS M,2,0) + if(BB_CDM HAVS H,3,0) + if(BB_CDM Confined Workplace L,1,0) + if(BB_CDM Confined Workplace M,2,0) + if(BB_CDM Confined Workplace H,3,0) + if(BB_CDM Access_Egress L,1,0) + if(BB_CDM Access_Egress M,2,0) + if(BB_CDM Access_Egress H,3,0) + if(BB_CDM Weight Limit L,1,0) + if(BB_CDM Weight Limit M,2,0) + if(BB_CDM Weight Limit H,3,0) + if(BB_CDM Residual Electricity L,1,0) + if(BB_CDM Residual Electricity M,2,0) + if(BB_CDM Residual Electricity H,3,0)

0 Likes
Message 4 of 5

ToanDN
Consultant
Consultant
Perhaps if you could clarify what this family is and what it is for. There maybe a different way to approach it.
0 Likes
Message 5 of 5

Daniel_Hinks
Enthusiast
Enthusiast

Hi,

I have sorted this in my own way in the end, but if you have any suggestions as to how i could have done it better that would be much appreciated.

 

I have a separate issue where i cannot get the total value i have calculated using the formulated parameter to appear in my project as text too. Any suggestions on this? I have posted this in the forum below, but thought i'd attached the video here as it will help you understand what i was trying to achieve originally (i.e. the original question above).

 

https://forums.autodesk.com/t5/revit-structure-forum/create-multiple-parameters-in-a-family/m-p/9909... 

 

Thanks

0 Likes