Results 1 to 10 of 10

Thread: Array formula

  1. #1
    Member
    Join Date
    May 25, 2011
    Posts
    192
    Current Local Time
    04:01 AM

    Not allowed! Not allowed!

    Array formula

    I added an array to a nested family and the parameter "DropCount" is not giving me the results I expect. Based on Hood Length, the drops are always 12" from the sides and max spacing is 36". So, at 61" hood length, the count result should be 3. The if stateemnt in the DropCount parameter is there so the count never goes below 2, which would break the array. Am I taking the wrong approach here?
    Click image for larger version. 

Name:	2.JPG 
Views:	92 
Size:	69.4 KB 
ID:	8516
    Attached Files Attached Files

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

    Not allowed! Not allowed!
    Try this. You may need to fine tune it to the sizes you need.
    2012-06-19_1617 - Alex_Cunningham's library
    You can play around with the Array Lenght formula to get it the react the way you need it too. Its basicaly a min or max for the distance between the array.


    i had to upgrade the family to 2012 as well.

    Clear as mud?
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    May 25, 2011
    Posts
    192
    Current Local Time
    04:01 AM

    Not allowed! Not allowed!
    Thanks for your suggestion Alex. It looks like your array length will return either a 12" or 36" value. This value would need to be variable, since the hood length can be anywhere from 30" to 14'-0" long. Sorry for not pointing this out.

    I am going to try using the spacing (created via "second") rather than overall array length (created via "last") in formula, adding 1 to DropCount if spacing < 36"

  4. #4
    Senior Member alexo4141's Avatar
    Join Date
    May 25, 2011
    Location
    Qubec, Canada
    Posts
    548
    Current Local Time
    05:01 AM

    Not allowed! Not allowed!
    Quote Originally Posted by Randy_CaS View Post
    Based on Hood Length, the drops are always 12" from the sides and max spacing is 36". So, at 61" hood length, the count result should be 3.
    If you're working on 2012, try that formula :
    if(Hood Length < 61", 2, (roundup(DropArrayLength / 36") + 1))

    This way, you'll get the max spacing at 36" (At least of what I have tested)
    Last edited by alexo4141; June 20th, 2012 at 12:58 PM.

  5. #5
    Member
    Join Date
    May 25, 2011
    Posts
    192
    Current Local Time
    04:01 AM

    Not allowed! Not allowed!
    Unfortunately I am still on 2010

  6. #6
    Senior Member alexo4141's Avatar
    Join Date
    May 25, 2011
    Location
    Qubec, Canada
    Posts
    548
    Current Local Time
    05:01 AM

    Not allowed! Not allowed!
    Ok then, use that one and it should do the trick...
    if(Hood Length < 61", 2, DropArrayLength / 36" + 1.49)

    Imagine you want a max. spacing of 36" and that you use that formula : (Drop array length / 36) + 1
    If you have 37", you'll get 2 (which is the not right answer)
    By adding 1.49, Revit will round it up if it's not an exact number.

    37/36=1.03
    1.03+1.49=2.52
    Revit rounds up to 3

    If the number you are dividing is exact, Revit will automatically round it down.
    72/36=2
    2+1.49=3.49
    Revit rounds it down to 3 because it stills under the 0.5 rounding limit.

    Hope it makes sense...
    Last edited by alexo4141; June 20th, 2012 at 05:44 PM.

  7. #7
    Member
    Join Date
    May 25, 2011
    Posts
    192
    Current Local Time
    04:01 AM

    Not allowed! Not allowed!
    I got it working and to be honest, I am not quite sure how lol. I futzed with it until I got the expected result. I did something a little different than your above suggestion, but I think it is the same concept.
    I figured since it was a rounding issue, I need to compare the number to the integer, so I added a number parameter with the same formula. I guess there are more than one way to get around the lack of rounding in 2010. Thanks again, Alex
    Click image for larger version. 

Name:	6.JPG 
Views:	44 
Size:	96.0 KB 
ID:	8543
    Attached Files Attached Files

  8. #8
    Senior Member alexo4141's Avatar
    Join Date
    May 25, 2011
    Location
    Qubec, Canada
    Posts
    548
    Current Local Time
    05:01 AM

    Not allowed! Not allowed!
    Nice to see it working.
    It's not that complicated but I really think you should try the +1.49... If it works fine, it will be much more simple.

    Just my 0.02

  9. #9
    Member
    Join Date
    May 25, 2011
    Posts
    192
    Current Local Time
    04:01 AM

    Not allowed! Not allowed!
    I will do that, I am curious as well.

    edit:
    I tested all possibilities with your 1.49 method and you are absolutely correct, it functions the same and is much less wonky. Thanks for making it so easy Alex
    Last edited by Randy_CaS; June 20th, 2012 at 07:53 PM.

  10. #10
    Senior Member alexo4141's Avatar
    Join Date
    May 25, 2011
    Location
    Qubec, Canada
    Posts
    548
    Current Local Time
    05:01 AM

    Not allowed! Not allowed!
    I'll post that trick in the "Revit Formulas for everyday usage" thread. It could be useful for somebody else.
    Thanks for being test subject

Similar Threads

  1. Replies: 0
    Last Post: February 7th, 2012, 04:45 AM
  2. Conditional Formula
    By Drew in forum Architecture - Family Creation
    Replies: 4
    Last Post: February 6th, 2012, 02:12 PM
  3. MAX value in formula
    By antonko in forum Structure - Family Creation
    Replies: 3
    Last Post: November 22nd, 2011, 06:01 PM
  4. Schedule formula (is there a formula expert in the house?)
    By John McCamont in forum Architecture and General Revit Questions
    Replies: 8
    Last Post: September 9th, 2011, 09:50 PM
  5. Formula Help
    By Alex Cunningham in forum Architecture and General Revit Questions
    Replies: 9
    Last Post: March 30th, 2011, 10:27 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
  •