LookUp Tables

Published on March 2017 | Categories: Documents | Downloads: 52 | Comments: 0 | Views: 388
of 3
Download PDF   Embed   Report

Comments

Content

Revit MEP text_file_lookup and Lookup Tables 
A customer recently inquired into the specifics of the abbreviations found in one of the pipe fitting  lookup tables.  For example, if you take a look at the definition of the “Pipe Reducing Double Short Tee ‐  Sanitary ‐ Glued.rfa” family (found by default in “C:\ProgramData\Autodesk\RME 2009\Imperial  Library\Pipe\Fittings\Tees”), you will see about 45 parameters, many of which have a formula that uses  the text_file_lookup function.  Many of the parameter names used in the body of the text_file_lookup  function are abbreviated.  The abbreviations aren’t as important as understanding how the  text_file_lookup function works.    The way the parameters work that use the text_file_lookup is that the function ‘looks up’ a value from a  table based on values that are specified when creating (or modifying) an instance of the family.  If the  ‘look up’ is not able to find a value in the table, a default value (specified in the function’s parameters) is  used.      Note that the text_file_lookup function is limited to returning COMMON:LENGTH type values or similar  derivatives, such as PIPING:PIPE SIZE, and HVAC:DUCT SIZE.  Thus, it is not possible to use this function  to lookup catalog numbers, descriptions, etc.   

Changing the LookupTableLocation Path 
The tables of values used by the text_file_lookup function are stored in the “LookupTables” folder.  You  may want to change this path to share all content definitions from a common location on a server.  By  default, this is “C:\ProgramData\Autodesk\RME 2009\LookupTables”.  The path to this folder can be  changed in the Revit.ini file, which itself is in C:\Program Files\Revit MEP 2009\Program\ by default.      In the [Directories] section of the Revit.ini is the ‘LookupTableLocation’ setting that points to this folder:   
[Directories] DefaultTemplate=C:\ProgramData\Autodesk\RME 2009\Imperial Templates\Mechanical-default.rte FamilyTemplatePath=C:\ProgramData\Autodesk\RME 2009\Imperial Templates DataLibraryLocations=Imperial Library=Imperial Library,Imperial Detail Library=Imperial Library\Detail Components ProjectPath= ImportLineweightsNameDWG=C:\Program Files\Revit MEP 2009\Data\importlineweights-dwg-default.txt LookupTableLocation=C:\ProgramData\Autodesk\RME 2009\LookupTables

  Changing the path of the LookupTableLocation will make Revit ‘look up’ these values from the newly  specified path.   

How the Lookup Works 
Let’s take a look at some examples of how this works.    For the above mentioned “Pipe Reducing Double Short Tee ‐ Sanitary – Glued” family, the ‘Pipe Outside  Diameter 3’ parameter is defined by the text_file_lookup function below (note the function definition  may be line wrapped in this document)   
text_file_lookup(Lookup Table Name, "POD3", Nominal Diameter 3, (Nominal Diameter 1), (Nominal Diameter 2), (Nominal Diameter 3))

  The text_file_lookup function can is generalized as follows: 
text_file_lookup(Lookup Table Name, Value Column, Default Value, Lookup Value 1,…, Lookup Value n)

  The first parameter of the text_file_lookup function is ‘Lookup Table Name’.  If you inspect the  parameters in the family, you will find a parameter called ‘Lookup Table Name’, and this has the Value  ‘Pipe Reducing Double Short Tee ‐ Sanitary ‐ Glued.csv’.  Thus, when an instance of “Pipe Reducing  Double Short Tee ‐ Sanitary – Glued” is created (or modified), Revit looks up the value from this file.  If  you open the .csv file in Excel, you will see a table 17 rows long and 16 columns wide.    The first column (shown below outlined in red) is not used by the text_file_lookup function in Revit.   This column is provided as a means to identify the row by the person editing the table.    The Value Column contains the value that is result of the text_file_lookup.  In this example, the Value  Column is “POD3”.  If you inspect the ‘Pipe Reducing Double Short Tee ‐ Sanitary ‐ Glued.csv’ file in  Excel, you will find that this is column G (shown highlighted in blue below). 

  How does Revit know which row from this column of values to use?  The Lookup Value 1…n parameters  to the text_file_lookup function provides the necessary input to allow Revit to figure out which row to  use.      In this example, the POD3 value is dependent on three input values, in this case, Nominal Diameter 1, 2,  and 3).  It is possible to lookup based only on a single value (such as in “Pipe Bend ‐ DWV ‐ Glued.rfa”),  or theoretically any arbitrary number of Lookup Values.      When looking up these values, Revit pays no attention to the parameter names or column names.  For  example, if you were to inspect the .csv file in excel, you would find that Column B is labeled ND2,  Column C, is labeled ND1, and Column D is labeled ND3… but these are used nowhere in the function –  the values are looked up strictly on the column order, starting in column B.    As a specific case of this example, plug in the following values for the Nominal Diameters as shown  below: 

 

    Inspecting the .csv file, this will return a value of 1.66 for the ‘Pipe Outside Diameter 3’ parameter: 

  In the family editor, this value is displayed formatted as 1 169/256”.  The values for Pipe Outside  Diameter 1 and 2 can be confirmed from columns F (POD1) and E (POD2) respectively (2.375 formatted  as 2 3/8”) 

 

 

 

Default Values 
If a row matching the input lookup values is not found, a default values is used.  Let’s use the following  input values: 

    In this case, there is no row that matches the specified lookup values, and thus, the text_file_lookup  uses the default value.  The 3rd parameter to the text_file_lookup provides the default value.      As shown highlighted below, the 3rd parameter to the text_file_lookup for ‘Pipe Outside Diameter 3’ is  ‘Nominal Diameter 3’.  Similarly, the default for Pipe Outside Diameter 2 is Nominal Diamter 2, and for  Pipe Outside Diameter 1 is Nominal Diameter 1.  The result is that the Pipe Outside Diameters directly  reflect the Nominal Diameters in this case. 

 

 

Summary 
Using the text_file_lookup function provides a convenient means to define parametric pipe fitting  content, and is flexible for use even if not all conditions are accounted for in the lookup tables by the  use of the default value parameter in the function. 

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close