Page 2 of 45 FirstFirst 12345612 ... LastLast
Results 11 to 20 of 441

Thread: Revit Formulas for "everyday" usage

  1. #11
    New Member CJ Follmer's Avatar
    Join Date
    December 10, 2010
    Location
    St. Louis MO
    Posts
    4
    Current Local Time
    10:24 AM

    Not allowed! Not allowed!
    Thanks a bunch for those. It will be a big help.

  2. #12
    Forum Co-Founder Alfredo Medina's Avatar
    Join Date
    December 7, 2010
    Location
    Orlando, FL, USA
    Posts
    3,244
    Current Local Time
    11:24 AM

    Not allowed! Not allowed!
    There is little to add to this comprehensive list. However, I would like to add this:

    Range of Values

    Given the following parameters:

    user_value:
    min_value:
    max_value:
    actual_value:

    Specify a range of valid entries, with the min_value and max_value parameters; then, use the actual value if it is within the range; otherwise, use your minimum or maximum values.

    Code:
    actual_value = if (user_value < min_value, min_value, if (user_value > max_value, max_value, user_value))
    An example of this was applied in my solution for the last month┤s thread about the corner piece challenge. See illustration.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	value range.JPG 
Views:	655 
Size:	28.0 KB 
ID:	1226  

  3. #13
    Moderator
    "Mark Twain"
    mdradvies's Avatar
    Join Date
    December 16, 2010
    Location
    Boxtel, Netherlands
    Posts
    4,564
    Current Local Time
    03:24 PM

    Not allowed! Not allowed!
    Great post Munk!
    One more comment on the if-statements when using combined with a yes/no-parameter:
    When using an if-statement for a yes/no-parameter the syntax is different.

    For instance:

    Door_width = 900 (length parameter)
    Building_Code OK (yes/no-parameter): Door_width>850
    There's no need to add the <if true>, <if false> part. It will actually give you an error.


    Also:
    When using formulas, revit is aware of the Units. So when you want this:

    Length1 = Length2*Length3 and they are all Length parameters, it will give you an error. Why? Because m x m = m2, which makes it an area parameter.
    You'll get the errror "incosistent units". The formula should be: (Length1*Length2)/1 to work.

  4. #14
    Moderator
    "RFO 2012 Spelling Bee Champion"
    Alex Cunningham's Avatar
    Join Date
    December 8, 2010
    Location
    Northern California
    Posts
    3,576
    Current Local Time
    08:24 AM

    Not allowed! Not allowed!
    Additionaly:
    The division of 2 lengths will return and interger or number. Handy for array constraints or use in trigonometry calcs.

  5. #15
    Moderator
    "OMG I killed Revit"
    dzatto's Avatar
    Join Date
    December 9, 2010
    Location
    Dallas, TX
    Posts
    5,280
    Current Local Time
    10:24 AM

    Not allowed! Not allowed!
    Currently, <= and >= are not implemented. To express such a comparison, you can use a logical NOT. For example, a<=b can be entered as NOT(a>b)

    What if I need this statement, but with another parameter in front of it? For example:

    Lift Height (NOT<1'). It gives me errors saying the left paranthesis is unexpected. If I take out the parenthesis, I get errors saying Lift Height NOT is not a valid parameter.

  6. #16
    Forum Co-Founder Alfredo Medina's Avatar
    Join Date
    December 7, 2010
    Location
    Orlando, FL, USA
    Posts
    3,244
    Current Local Time
    11:24 AM

    Not allowed! Not allowed!
    I guess in the case of the lift it is better to use a range of minimum and maximum values. See reply # 12.

  7. #17
    Administrator Munkholm's Avatar
    Join Date
    December 7, 2010
    Location
    Kingdom of Denmark
    Posts
    4,287
    Current Local Time
    05:24 PM

    Not allowed! Not allowed!
    Dan, I┤m assuming that "Lift Height" is a length parameter, and you don┤t want that to be less than 1'
    If that┤s the case, you should have a look at Alfredo┤s post above (#12)

  8. #18
    Moderator
    "OMG I killed Revit"
    dzatto's Avatar
    Join Date
    December 9, 2010
    Location
    Dallas, TX
    Posts
    5,280
    Current Local Time
    10:24 AM

    Not allowed! Not allowed!
    Well sort of. That formula may still work, but let me explain what I'm trying to do.

    The lift has ramps attached to it. When it is down, they are flat. When it is up the ends of them fall down with gravity so they are now angled. I used a Yes / no formula to control the visibility of which ramp configuration I need. The problem is that it's set to change at 1', and it does, but if the height is exactly 1' neither of them show! I really need a <= formula but I read in Munk's post that it's not possible.

    So, is this the correct formula?

  9. #19
    Administrator Munkholm's Avatar
    Join Date
    December 7, 2010
    Location
    Kingdom of Denmark
    Posts
    4,287
    Current Local Time
    05:24 PM

    Not allowed! Not allowed!
    Can you post the family...? not sure that I understand...

  10. #20
    Administrator Munkholm's Avatar
    Join Date
    December 7, 2010
    Location
    Kingdom of Denmark
    Posts
    4,287
    Current Local Time
    05:24 PM

    Not allowed! Not allowed!
    Ahh... think I know what you┤re wanting to do... the NOT(a>b) doesn┤t work with Yes/No (visibility) parameters, instead you can use a NOT as shown in the attached

    But... now that you figured the trig, maybe you should just add a Angle parameter to the Ramp, so it slides over the floor at an angle when the lift is raised from the floor ?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	ramp_not.JPG 
Views:	585 
Size:	28.5 KB 
ID:	1282  

Similar Threads

  1. Fˇrmulas de Revit para el "uso diario"
    By Munkholm in forum Foro Espa˝ol
    Replies: 12
    Last Post: December 14th, 2017, 05:44 PM
  2. Replies: 3
    Last Post: March 18th, 2016, 10:32 PM
  3. Slab slope discrepancy btw "Slope arrow" and "Define Slope"
    By jh75 in forum Structure - General Questions
    Replies: 3
    Last Post: May 6th, 2011, 08:39 PM
  4. Revit 2011 - "Black rendering" with Non-English Win XP
    By Munkholm in forum Tutorials, Tips & Tricks
    Replies: 0
    Last Post: January 10th, 2011, 08:15 AM
  5. Replies: 2
    Last Post: January 7th, 2011, 06:19 PM

Posting Permissions

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