Announcement

Collapse
No announcement yet.

Revit Formula Query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Thanks in advance

    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. :laugh:
    "One must imagine Sisyphus happy." Albert Camus - "The innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may ​do well under the new." Nicolo Machiavelli -"Things that are too complex are not useful, Things that are useful are simple." Mikhail Kalashnikov

    Comment


      #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.

      Comment

      Related Topics

      Collapse

      Working...
      X