Goal amount for this year: 2500 USD, Received: 1869 USD (75%)

1. ## Revit Formula Query

Hi,

I am trying to write a formula for Revit that does the following:

(IF (Parameter 1 is ticked) AND (Parameter 2 is ticked) THEN show text "WORDS" OR IF (Parameter 1 is ticked) AND (Parameter 2 is unticked) THEN from Parameter 3 subtract 300 OR IF (Parameter 1 is unticked) AND (Parameter 2 is ticked) THEN from Parameter 3 subtract 500.

By ticked or unticked I mean the parameter is a Yes/No Parameter.

B

2. Have a look at this if you want to combine different boolean functions;
AB327-4 Fuzzy Math Essentials for Revit Family Builders - Documents

Its also available on AUGI.

However, my personal opinion is that it is better to avoid setting multiple parameters in different configurations by using formulas, that is what Types are for.

3. First off, you're confusing inputs and outputs - both in terms of parameter value types and with respect to formula construction.

As in? You've a text value return in the first part:

if(and(P1,P2),"WORDS",

but then switch to a number/length/integer (?) value in the subsequent parts (where you start talking about subtractions)

So you need to break things down to build this all up...

Firstly, establish what P3 is doing (value wise) - and you will need a product/result parameter for that (unless P3 itself is a product, in which case you could use the definition here in it's place)

P3_product=if(and(P1,not(P2)),P3-300,if(and(P2,not(P1)),P3-500,P3)

then think about what the text return values of the above will be, i.e.

<text parameter> = if(and(P1,not(P2)), "P1 is ticked, P2 is not", if(and(P2,not(P1)),"P2 is ticked, P1 is not",if(and(P1,P2)),"both are ticked","none are ticked"))))))))))

^I'm writing this freehand, away from Revit, and with a somewhat glib tint - copy-pasting these "solutions" won't help (they won't work as I've not counted up the closed parenthesis correctly, deliberately) but should give you some food for thought.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•