Вы находитесь на странице: 1из 3

RevitMEPtext_file_lookupandLookupTables

Acustomerrecentlyinquiredintothespecificsoftheabbreviationsfoundinoneofthepipefitting lookuptables.Forexample,ifyoutakealookatthedefinitionofthePipeReducingDoubleShortTee SanitaryGlued.rfafamily(foundbydefaultinC:\ProgramData\Autodesk\RME2009\Imperial Library\Pipe\Fittings\Tees),youwillseeabout45parameters,manyofwhichhaveaformulathatuses thetext_file_lookupfunction.Manyoftheparameternamesusedinthebodyofthetext_file_lookup functionareabbreviated.Theabbreviationsarentasimportantasunderstandinghowthe text_file_lookupfunctionworks. Thewaytheparametersworkthatusethetext_file_lookupisthatthefunctionlooksupavaluefroma tablebasedonvaluesthatarespecifiedwhencreating(ormodifying)aninstanceofthefamily.Ifthe lookupisnotabletofindavalueinthetable,adefaultvalue(specifiedinthefunctionsparameters)is used. Notethatthetext_file_lookupfunctionislimitedtoreturningCOMMON:LENGTHtypevaluesorsimilar derivatives,suchasPIPING:PIPESIZE,andHVAC:DUCTSIZE.Thus,itisnotpossibletousethisfunction tolookupcatalognumbers,descriptions,etc.

ChangingtheLookupTableLocationPath
Thetablesofvaluesusedbythetext_file_lookupfunctionarestoredintheLookupTablesfolder.You maywanttochangethispathtoshareallcontentdefinitionsfromacommonlocationonaserver.By default,thisisC:\ProgramData\Autodesk\RME2009\LookupTables.Thepathtothisfoldercanbe changedintheRevit.inifile,whichitselfisinC:\ProgramFiles\RevitMEP2009\Program\bydefault. Inthe[Directories]sectionoftheRevit.iniistheLookupTableLocationsettingthatpointstothisfolder:
[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

ChangingthepathoftheLookupTableLocationwillmakeRevitlookupthesevaluesfromthenewly specifiedpath.

HowtheLookupWorks
Letstakealookatsomeexamplesofhowthisworks. FortheabovementionedPipeReducingDoubleShortTeeSanitaryGluedfamily,thePipeOutside Diameter3parameterisdefinedbythetext_file_lookupfunctionbelow(notethefunctiondefinition maybelinewrappedinthisdocument)
text_file_lookup(Lookup Table Name, "POD3", Nominal Diameter 3, (Nominal Diameter 1), (Nominal Diameter 2), (Nominal Diameter 3))

Thetext_file_lookupfunctioncanisgeneralizedasfollows:
text_file_lookup(Lookup Table Name, Value Column, Default Value, Lookup Value 1,, Lookup Value n)

Thefirstparameterofthetext_file_lookupfunctionisLookupTableName.Ifyouinspectthe parametersinthefamily,youwillfindaparametercalledLookupTableName,andthishastheValue PipeReducingDoubleShortTeeSanitaryGlued.csv.Thus,whenaninstanceofPipeReducing DoubleShortTeeSanitaryGluediscreated(ormodified),Revitlooksupthevaluefromthisfile.If youopenthe.csvfileinExcel,youwillseeatable17rowslongand16columnswide. Thefirstcolumn(shownbelowoutlinedinred)isnotusedbythetext_file_lookupfunctioninRevit. Thiscolumnisprovidedasameanstoidentifytherowbythepersoneditingthetable. TheValueColumncontainsthevaluethatisresultofthetext_file_lookup.Inthisexample,theValue ColumnisPOD3.IfyouinspectthePipeReducingDoubleShortTeeSanitaryGlued.csvfilein Excel,youwillfindthatthisiscolumnG(shownhighlightedinbluebelow).

HowdoesRevitknowwhichrowfromthiscolumnofvaluestouse?TheLookupValue1nparameters tothetext_file_lookupfunctionprovidesthenecessaryinputtoallowRevittofigureoutwhichrowto use. Inthisexample,thePOD3valueisdependentonthreeinputvalues,inthiscase,NominalDiameter1,2, and3).Itispossibletolookupbasedonlyonasinglevalue(suchasinPipeBendDWVGlued.rfa), ortheoreticallyanyarbitrarynumberofLookupValues. Whenlookingupthesevalues,Revitpaysnoattentiontotheparameternamesorcolumnnames.For example,ifyouweretoinspectthe.csvfileinexcel,youwouldfindthatColumnBislabeledND2, ColumnC,islabeledND1,andColumnDislabeledND3buttheseareusednowhereinthefunction thevaluesarelookedupstrictlyonthecolumnorder,startingincolumnB. Asaspecificcaseofthisexample,pluginthefollowingvaluesfortheNominalDiametersasshown below:

Inspectingthe.csvfile,thiswillreturnavalueof1.66forthePipeOutsideDiameter3parameter:

Inthefamilyeditor,thisvalueisdisplayedformattedas1169/256.ThevaluesforPipeOutside Diameter1and2canbeconfirmedfromcolumnsF(POD1)andE(POD2)respectively(2.375formatted as23/8)

DefaultValues
Ifarowmatchingtheinputlookupvaluesisnotfound,adefaultvaluesisused.Letsusethefollowing inputvalues:

Inthiscase,thereisnorowthatmatchesthespecifiedlookupvalues,andthus,thetext_file_lookup usesthedefaultvalue.The3rdparametertothetext_file_lookupprovidesthedefaultvalue. Asshownhighlightedbelow,the3rdparametertothetext_file_lookupforPipeOutsideDiameter3is NominalDiameter3.Similarly,thedefaultforPipeOutsideDiameter2isNominalDiamter2,andfor PipeOutsideDiameter1isNominalDiameter1.TheresultisthatthePipeOutsideDiametersdirectly reflecttheNominalDiametersinthiscase.

Summary
Usingthetext_file_lookupfunctionprovidesaconvenientmeanstodefineparametricpipefitting content,andisflexibleforuseevenifnotallconditionsareaccountedforinthelookuptablesbythe useofthedefaultvalueparameterinthefunction.

Вам также может понравиться