Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By josephpeel

Thread: Algorithm to find size_lookup values from "in-between" parameter values?

  1. #1
    Member
    Join Date
    April 10, 2014
    Posts
    73
    Current Local Time
    11:40 PM

    Algorithm to find size_lookup values from "in-between" parameter values?

    I have calculated a required diameter. I need to lookup the next available size of pipe that's greater than the required value. In Excel, I would use VLOOKUP with EXACT set to false. Does anybody have a handy algorithm for use with size_lookup?

  2. #2
    Senior Member ekkonap's Avatar
    Join Date
    May 23, 2011
    Location
    Netherlands
    Posts
    583
    Current Local Time
    05:40 AM
    Next available? So simply rounding up wont do you any good. You could add extra lines in the table for every whole number between valid values and round up your input value. You could also modify your input value, like: newinput=
    If(originalinput<6,6,if(originalinput<9,9,if(origi nalinput<13,13,17))) where 6,9,13 and 17 are valid lookup values in your table.

  3. #3
    Member
    Join Date
    April 10, 2014
    Posts
    73
    Current Local Time
    11:40 PM
    ekkonap, you have indeed come up with a better way. I did this:
    IF (AND(C D2 01 > 0, NOT(C D2 01 > 250)),16,IF (AND(C D2 01 > 250, NOT(C D2 01 > 438)),21,IF (AND(C D2 01 > 438,
    ...etc. which enumerates the intervals, but your way reduces the search space each iteration. Thanks!

  4. #4
    Forum Addict josephpeel's Avatar
    Join Date
    May 3, 2012
    Posts
    1,401
    Current Local Time
    05:40 AM
    Is this for Fittings?
    Personally I cant stand lookup tables and find using formulas for all sizes to be much more reliable (And formulas should work for any possible size).

    You can use nested IF statements as Ekko suggests, but what also works very well is to calculate all sizes using formulas based on the Nominal Diameter of the pipe (Which will always be one of the standard pipe sizes available in Revit).

    Use a 'Y = aX + b' formula for a straight line and set the a and b constants to fit the standard/manufacturers data.
    This is easy to do in excel, just graph Nominal Diameter against the dimension you want to set and get the constants from a linear regression line.
    (Or use Y = aX^2 + bX + c if a linear relationship between sizes is not accurate enough)
    This way the fitting works for any (new) possible pipe size and is automatically interpolated to fit. If the pipe sizes in the project are correct then the calculated sizes should also be standard dimensions.
    For some sizes the result may be a few millimeters out, but you can use roundup or accept that it is within construction tolerances anyway.


    The constants can be set per type, so it is also possible to make a standard fitting family that sizes correctly for multiple material thicknesses or bend radiuses etc, just by setting different values of a and b for the formulas.
    I find that this makes very robust, reliable families, which can easily be adapted to new pipe types using Edit Type instead of making new families.
    Attached Thumbnails Attached Thumbnails Algorithm to find size_lookup values from &quot;in-between&quot; parameter values?-example-chart.jpg  
    Last edited by josephpeel; January 6th, 2019 at 07:45 PM.
    ekkonap likes this.

  5. #5
    Member
    Join Date
    April 10, 2014
    Posts
    73
    Current Local Time
    11:40 PM
    Joseph, not for fittings, but for calculating the pipes
    in several conduit groups
    needed to accommodate the net cross-sectional area of a mix of AV wires of different EMI susceptibilities. Since the wires themselves change from project to project, I have tables of wire type parameters, notably diameter, that can be updated fairly easily. I'm leery about hard-coding values.
    I don't use the Revit conduits - not enough parameters and my discipline isn't responsible to install the pipe, but only to specify some parameters for installation by others. I revisit the idea every few months, though. Thanks for the help.

Similar Threads

  1. easy way to "find" (duplicated) view(s) of sheet in project browser
    By Ning Zhou in forum Architecture and General Revit Questions
    Replies: 7
    Last Post: October 19th, 2018, 02:05 PM
  2. Imported Categories Named "1" - Cannot purge/delete/find in groups...
    By Jj Mac in forum Architecture and General Revit Questions
    Replies: 11
    Last Post: April 25th, 2018, 01:29 PM
  3. Replies: 7
    Last Post: June 24th, 2016, 05:38 PM
  4. "Values can vary by group instance" for parameter
    By Rick Moore in forum Architecture and General Revit Questions
    Replies: 8
    Last Post: May 11th, 2016, 01:41 PM
  5. "Title on Sheet" parameter field" ?
    By Dave Jones in forum Architecture and General Revit Questions
    Replies: 2
    Last Post: October 17th, 2011, 12:17 AM

Posting Permissions

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