I created a sample lookup table as follows:
In Revit, the parameters in the test family:
A text parameter is created in the family called 'Type Name'. The formula is broken down as follows:
- size_lookup
Tells Revit it's a lookup command
- (Lookup Table,
Refers to the lookup table name in the 'Lookup Table' parameter
- "",
Usually there is a value between the quotation marks. This refers to which column to reference in the lookup table, but in this case we create a 'null' value. This is what allows this method to work
- "NOT SPECIFIED",
The text value that is used if there is no matching value in the lookup parameter
- Size)
the lookup parameter value for the lookup formula to reference.
I'm not sure why this actually works, but I suspect that even though the syntax for the formula is correct for a lookup, the omission of a search column reference means it returns the first value it comes across, which is the 'Type Name' in the first column.
Hope this is useful.
10 comments:
Great Post,
A few questions though...
When I place a family with an inconsistent unit I seem to get an error message.
I would like the Lookup table t provide the data for Weight, where it sources the information through the diameter.
the weight parameter is Structural, Force, Lbs
the Diameter parameter is HVAC, Duct size, mm
size_lookup(LookupTableName, "Weight", 0 lbs, Diameter1) - this formula creates the error message.
Is there a way around this?
Also this would create a solution to the duct work content creation with product codes; at the moment I append manufacturers product codes via a 6 digit numeric input but the parameter is read as a length parameter because of the error of inconsistent units.
Thanks
Hi Domino
In both cases, the 'Diameter1' parameter must be divided by one to neutralise the units:
size_lookup(LookupTableName, "Weight", 0 lbs, Diameter1/1)
The six figure product code can be set up in the family as an integer parameter(assuming the code is only numeric).
For example, if it's called 'ProductCode':
size_lookup(LookupTableName, "ProductCode", 0 , Diameter1/1)
Hope that helps.
Hi Darren,
Out of interest where could you see look up tables being used for Structural applications? I have seen look up tables used to great effect with drawing pipework runs and valves in the past.
Hi Lee
Specifically I have used these to reference steelwork information. For example: In a cell beam family I can define the top and bottom sections by referencing lookup information.
Regards
Darren
In your original post what type of parameter is the "Size"?
When I use Text or Integer the formula results with an error 'inconsistent units'?
Hi Andrew.
The 'Size' parameter is an integer parameter.
Hi Darren,
Wonderful discovery! Mind if I incorporate it in the formula workshop at RTC Porto? Wish I had learned of it sooner!
Hi
Glad to be of help and absolutely fine to include in your RTC workshop
Hi Darren, thanks for the post.
Do you (or anyone else on here) have another trick up your sleeve to go the other way? I'm looking to have a lookup table return a number value while checking against a text value. If param is "A" then return "1", etc. This would be a real breakthrough since conditional formulas in Revit don't take text input (if(param="A",1,0) etc is not supported). Thanks much!
Has anyone tried this after Revit 2018?
Post a Comment