Announcement

Collapse
No announcement yet.

Parameter Formula Help

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

    Parameter Formula Help

    Hello!

    I've been pulling my hair out trying to figure out a visibility parameter formula based on inputted value to create a parametric family and was wondering if anyone can help me with this because this is my first time attempting with conditional statements in Revit. I'm attempting to recreate a parametric scale bar family I found on Youtube so that my team can simply choose whichever scale they need from a preset list. In my family, I created 2 different scale bars which fit 1"=1'-0" and another that fits 1-1/2"=1'-0" which are named Scale 1 and Scale 2 respectively. I have 2 different value parameters set correctly for both of the scales. The trouble I am having is the visibility. I want only one scale bar to show at a time and also have the option to be manually completely turned off when needed. I have set 3 "yes/no" parameters, Scale 1, Scale 2, and Scale Visible. I figured out the conditional part, but having trouble with the <true>,<false> input values. I tried writing out the scenario below which worked for Scale 1, but when I try repeat it with slight modification for Scale 2, I get the error message "There is a circular chain of references among the formulas."

    Formula written out on what I want it to do:
    Scale 1 : IF scale is visible AND value 1 > value 2 THEN scale 1 is visible AND scale 2 is NOT. IF FALSE THEN scale 1 is NOT visible AND scale 2 is.
    Scale 2 : IF scale is visible AND value 2 > value 1 THEN scale 2 is visible AND scale 1 is NOT. IF FALSE THEN scale 2 is NOT visible AND scale 1 is.

    The formula I have written:
    Scale 1 : if(and(Scale Visible,Value 1 > Value 2), not(Scale 2), Scale Visible)
    Scale 2 : if(and(Scale Visible,Value 2 > Value 1), not(Scale 1), Scale Visible) *ERROR MESSAGE "There is a circular chain of references among the formulas."

    I have attached an image of my parameters for everyone to have a look. I've tried looking at multiple Youtube videos and forums to better understand the use of conditional statements, but I am not very good with it so the help would be much appreciated!
    Attached Files

    #2
    Just use a Family Type Parameter. No need to do any of that with the formulas.

    Sent from my Pixel 3 XL using Tapatalk
    Aaron "selfish AND petulant" Maller |P A R A L L A X T E A M | Practice Technology Implementation
    @Web | @Twitter | @LinkedIn | @Email

    Comment


      #3
      Originally posted by Dfinite View Post
      I am not very good with it so the help would be much appreciated!
      Don't be disheartened, we all had to start somewhere, and a scale bar is as good a place as any!

      Welcome to the forum btw! :thumbsup:

      There's nothing wrong with how you've started off - but step back, and consider what a scale is actually doing, and how the values change. i.e. instead of having layers of visibility control and pre-determined values, change the label value(s) once.

      I've attached a (slightly modified version of) ours -which yes, does not look like yours, nor parametrically extends in length of height (even though the parameters suggest it might) - but hopefully should steer you on your way with how to use IFs

      scale.PNG

      SCALE.rfa
      Last edited by snowyweston; March 14, 2021, 04:24 PM.

      Comment


        #4
        Originally posted by Twiceroadsfool View Post
        Just use a Family Type Parameter. No need to do any of that with the formulas.

        Sent from my Pixel 3 XL using Tapatalk
        I am definitely probably over complicating things than it needs to be :laugh:, but it has definitely been good practice for me to understand how conditional statements work.

        Comment


          #5
          Probably won't do this for my scale bar, but fun little, 'project' to learn stuff with for sure, so I'll help you with this anyway.

          Your circular reference is because of this:

          if(and(Scale Visible,Value 1 > Value 2), not(Scale 2), Scale Visible)

          What this says is that the formula checks is Scale Visible is turned on and if it is it turns the Scale Visible on (but it already is on)


          I have done something similar with my Multi Cat. Tags to make sure the leader stays in the same place when I change data.


          First you don't need the IF in there and I have 2 sets of parameters, the ones that I use to choose what I wanna see and the ones that do the calculation for the outcome

          tag.JPG

          This might help you on your way a bit more
          Company Website: www.deurloobm.nl
          Revit Ideas: Is this family Mirrored? | Approve warnings | Family Type parameter just those in the family

          Comment


            #6
            Originally posted by snowyweston View Post
            Don't be disheartened, we all had to start somewhere, and a scale bar is as good a place as any!

            Welcome to the forum btw! :thumbsup:

            There's nothing wrong with how you've started off - but step back, and consider what a scale is actually doing, and how the values change. i.e. instead of having layers of visibility control and pre-determined values, change the label value(s) once.

            I've attached a (slightly modified version of) ours -which yes, does not look like yours, nor parametrically extends in length of height (even though the parameters suggest it might) - but hopefully should steer you on your way with how to use IFs

            [ATTACH=CONFIG]40229[/ATTACH]

            [ATTACH]40228[/ATTACH]
            Originally posted by snowyweston View Post
            Don't be disheartened, we all had to start somewhere, and a scale bar is as good a place as any!

            Welcome to the forum btw! :thumbsup:

            There's nothing wrong with how you've started off - but step back, and consider what a scale is actually doing, and how the values change. i.e. instead of having layers of visibility control and pre-determined values, change the label value(s) once.

            I've attached a (slightly modified version of) ours -which yes, does not look like yours, nor parametrically extends in length of height (even though the parameters suggest it might) - but hopefully should steer you on your way with how to use IFs

            [ATTACH=CONFIG]40229[/ATTACH]

            [ATTACH]40228[/ATTACH]
            Thanks for the warm welcome and much appreciate the help! I took a look at the family you kindly provided and it definitely helps me see how I can simplify mines in a few areas. I think one of the difficulties is because we have to work in imperial which created that weird scale for multipliers of 1-1/2" = 1'-0" which also affects the length of the scale. Another challenge I made for myself was to have it so that the values under the scale would be simple single whole numbers either in inches or feet if possible. :laugh:

            Comment


              #7
              Originally posted by Robin Deurloo View Post
              Probably won't do this for my scale bar, but fun little, 'project' to learn stuff with for sure, so I'll help you with this anyway.

              Your circular reference is because of this:

              if(and(Scale Visible,Value 1 > Value 2), not(Scale 2), Scale Visible)

              What this says is that the formula checks is Scale Visible is turned on and if it is it turns the Scale Visible on (but it already is on)


              I have done something similar with my Multi Cat. Tags to make sure the leader stays in the same place when I change data.


              First you don't need the IF in there and I have 2 sets of parameters, the ones that I use to choose what I wanna see and the ones that do the calculation for the outcome

              [ATTACH=CONFIG]40230[/ATTACH]

              This might help you on your way a bit more
              Thank you so much for entertaining me with this little project of mine and helping. You definitely helped me understand where I was going wrong and I think I may know how to fix it now. I was also wondering about the "IF" because I did see some other formulas skip the IF and go straight to using AND/OR. What does the IF do for parameter formulas or what conditions require its use?

              Comment


                #8
                The IF is kinda build into the Yes/No parameter basically.
                For other types of parameters you are going to need the IF.
                Company Website: www.deurloobm.nl
                Revit Ideas: Is this family Mirrored? | Approve warnings | Family Type parameter just those in the family

                Comment

                Related Topics

                Collapse

                Working...
                X