The true power and flexibility of PIPE-FLO® Professional's new Data Import feature comes to light when taking advantage of Python™ scripting to generate or retrieve data. It does require some knowledge to get the most out of it, but it can greatly streamline your data entry processes once you have invested the time to get a script in place.
A .csv file is a common file format for tabulated data. It can be created in Microsoft® Excel, most text editors, or as an output from various software packages such as CAD and PDMS programs. The ability to set Design Data from an external file using Data Import allows the use of a single script for multiple projects or multiple lineups in a single project. This can save time and avoid error in the input of Design Data for the piping system model.
The example below reads pipe data (name, length, and size) from a CSV file and imports them into a PIPE-FLO Professional model. In this case the pipe names correspond to Tutorial Complete v12- US Units.pipe, which can also be found in the Sample Systems sub folder in Projects. The text below can also be copied into a text editor to create the pipe_data.csv and read_pipe.py files necessary to run this example in PIPE-FLO.
The pipe_data.csv file consists of pipe name, length, and size in comma delimited rows:
The Data Import File (.py) locates pipe_data.csv and uses a loop to read, set and print to the Output window for each row in the .csv file. The # indicates lines that are commented out for explanation of the script.
Once created, the file can be opened in PIPE-FLO by dragging the file onto the FLO-Sheet or clicking the Data Importbutton and open the file from there. Important: The .csv file must be properly named and in the same folder as the .py file for this script to work. Notice that the script prints the values from the csv file in the Output tab, and the Errors tab is empty.
The real value in this script is not the time saved to input the values from the csv file for a single project, but the flexibility to drop any .csv file in this folder with the Name\Length\Size format into the folder and rerun the script at any time. This could be for future revisions to this model or be applied to any PIPE-FLO model and any csv file pair as long as the pipe names match and the sizes are valid for the pipe specification in the model. Essentially, the time investment to develop a flexible script can provide savings on all current and future models.