<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Text in formula if/then in Revit Architecture Forum</title>
    <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12194003#M40551</link>
    <description>&lt;P&gt;Looks like you have 14 open brackets and 16 closed brackets. You need to remove 2 brackets from the end.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 13:41:10 GMT</pubDate>
    <dc:creator>Mike.FORM</dc:creator>
    <dc:date>2023-08-24T13:41:10Z</dc:date>
    <item>
      <title>Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12189994#M40543</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know that formulas in families are very limited to mathematical numbers and only adopts text when there's an If/Then condition. However is it possible to have both an If/Then condition and If/And condition in the same formula?&lt;BR /&gt;&lt;BR /&gt;I have a family with 4 Yes/No tick boxes. Currently I have a If/Then formula that states:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(Box1, "AA", if(Box2, "BB", if(Box3, "CC", if(Box4, "DD", ""))))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to make it something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(Box1, "AA", if(Box2, "BB", if(Box3, "CC", if(Box4, "DD", &lt;STRONG&gt;if(And(Box4, Box 1, "DDAA",&amp;nbsp;if(And(Box3, Box 2, "CCBB",&lt;/STRONG&gt; ""))))))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so that if the user ticks 2 boxes it combines their value into 1 text field.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is something like this possible in the formulas or is there a work around this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 05:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12189994#M40543</guid>
      <dc:creator>laura.johanssonPN37Y</dc:creator>
      <dc:date>2023-08-23T05:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190037#M40544</link>
      <description>&lt;P&gt;You have to fix the structure of your formula.&lt;/P&gt;
&lt;P&gt;The formula is And(Box1,Box2) and if(X, true,false)&lt;/P&gt;
&lt;P&gt;So combined it becomes if(And(Box1,Box2), true, false)&lt;/P&gt;
&lt;P&gt;See the position of the brackets&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 06:02:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190037#M40544</guid>
      <dc:creator>L.Maas</dc:creator>
      <dc:date>2023-08-23T06:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190074#M40545</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13192735"&gt;@laura.johanssonPN37Y&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible but in the first part of your formula, you need to first specify that Box1 is clicked "alone" so it should be something like and(Box1, not(or(Box2, Box3, Box4))) so the text would be "AA" if only Box1 is clicked. However that would make the formula quite complicated ultimately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would advise, is to use integer flags with a helper parameter named BOX_SCORE (name is for example). BOX_SCORE would get a value that would change according to which boxes are checked. All the boxes values would be incremental powers of 2 (very important as it prevents overlapping scores)?&lt;/P&gt;&lt;P&gt;- Box1's value would be 1 (2⁰)&lt;/P&gt;&lt;P&gt;- Box2's value would be 2 (2¹)&lt;/P&gt;&lt;P&gt;- Box3's value would be 4 (2²)&lt;/P&gt;&lt;P&gt;- Box4's value would be 8 (2³)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would calculate BOX_SCORE with a formula like this (not sure it works properly as I don't have Revit opened right now but you would need to tweak this accordingly then).&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;= if(Box1, 1, 0) + if(Box2, 2, 0) + if(Box3, 4, 0) + if(Box4, 8, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then your formula would look like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if(BOX_SCORE = 1, "AA",
if(BOX_SCORE = 2, "BB",
if(BOX_SCORE = 4, "CC",
if(BOX_SCORE = 8, "DD",
if(BOX_SCORE = 9, "DDAA",
if(BOX_SCORE = 6, "CCBB",
""))))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is way cleaner.&lt;/P&gt;&lt;P&gt;If you want to map all cases, you would need to go up to a 15 score as it's the maximum possible value (1+2+4+8 meaning all the boxes are checked).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 06:24:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190074#M40545</guid>
      <dc:creator>MetalFingerz</dc:creator>
      <dc:date>2023-08-23T06:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190080#M40546</link>
      <description>&lt;P&gt;Seems to work, with some modifications on the parenthesis side:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if(Box1, "AA", if(Box2, "BB", if(Box3, "CC", if(Box4, "DD", if(And(Box4, Box1), "DDAA", if(And(Box3, Box2), "CCBB", "false"))))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT. As soon as one of the evaluations turns out &lt;EM&gt;true&lt;/EM&gt;, the rest of the line isn't evaluated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I revert to &lt;A href="https://www.revitforum.org/node/1126" target="_blank" rel="noopener"&gt;this page&lt;/A&gt; for formulas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 06:20:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190080#M40546</guid>
      <dc:creator>Simon_Weel</dc:creator>
      <dc:date>2023-08-23T06:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190974#M40547</link>
      <description>&lt;P&gt;The formula will work as intended if they check the AND conditionals before the singular conditionals.&lt;/P&gt;&lt;P&gt;if you format in this order - if(and(Box1, Box2), "AABB", if(Box1, "AA", "")) - you will check if multiple boxes are ticked first and then check for singular boxes.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 12:59:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12190974#M40547</guid>
      <dc:creator>Mike.FORM</dc:creator>
      <dc:date>2023-08-23T12:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12191438#M40548</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13192735"&gt;@laura.johanssonPN37Y&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(Box1, "AA", if(Box2, "BB", if(Box3, "CC", if(Box4, "DD", &lt;STRONG&gt;if(And(Box4, Box 1&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;, "DDAA",&amp;nbsp;if(And(Box3, Box 2&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;, "CCBB",&lt;/STRONG&gt; ""))))))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are missing a few brackets &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 15:16:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12191438#M40548</guid>
      <dc:creator>ToanDN</dc:creator>
      <dc:date>2023-08-23T15:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12192848#M40549</link>
      <description>That is great, Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7063269"&gt;@Mike.FORM&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;I rewrote the formula according to your suggestions and started replacing Box with codes that I was in there, and the formula works for the most part apart when I want to have Box 1 and 3 ticked. See formula below:&lt;BR /&gt;&lt;BR /&gt;if(and(Box 1, Box 2), "FD-G", if(and(Box 1, Box 3), "FD-CG", if(Box 1, "FD", if(and(Box 2, Box 3), "-", if(Box 2, "SD-G"), if(and(Box 3, Box 4), "-", if(Box 3, "SD-CG"), if(and(Box 1, Box 2), "FD-G", if(Box 1, "FD"), if(Box 4, "SD", ""))))))))&lt;BR /&gt;&lt;BR /&gt;It keeps bringing up error that its wrong boolean statement, or that end expression unexpected.&lt;BR /&gt;&lt;BR /&gt;Basically I want the formula to say when FD and SD-G is ticked then the code becomes FD-G.&lt;BR /&gt;&lt;BR /&gt;Now I am thinking, previously I tried the AA + BB = AABB which included all letters of each code, so instead of having FD-G does the Box 1 + box 2 ticked need to be "FD SD-G" for it to work?</description>
      <pubDate>Thu, 24 Aug 2023 03:45:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12192848#M40549</guid>
      <dc:creator>laura.johanssonPN37Y</dc:creator>
      <dc:date>2023-08-24T03:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12193181#M40550</link>
      <description>&lt;P&gt;as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/244938"&gt;@ToanDN&lt;/a&gt;&amp;nbsp;says and another thing to watch out for - spaces in parameter / variable names can bite you....&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 07:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12193181#M40550</guid>
      <dc:creator>Simon_Weel</dc:creator>
      <dc:date>2023-08-24T07:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12194003#M40551</link>
      <description>&lt;P&gt;Looks like you have 14 open brackets and 16 closed brackets. You need to remove 2 brackets from the end.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 13:41:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12194003#M40551</guid>
      <dc:creator>Mike.FORM</dc:creator>
      <dc:date>2023-08-24T13:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Text in formula if/then</title>
      <link>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12195472#M40552</link>
      <description>&lt;P&gt;Thanks All, I went back to scratch, and started rewriting the formula and kept adding a bracket in every time I had an open bracket and it worked in the end. Man, those brackets are annoying. One little bracket too many or a "," misplaced and the whole formula fails. But we got there in the end. Thank you all for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 02:37:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-architecture-forum/text-in-formula-if-then/m-p/12195472#M40552</guid>
      <dc:creator>laura.johanssonPN37Y</dc:creator>
      <dc:date>2023-08-25T02:37:58Z</dc:date>
    </item>
  </channel>
</rss>

