# Example Scripts - Scripting

Example scripts can be found in the "[FluidFlow3 folder]\QA Scripting" folder. A brief overview and explanation of some of the scripts is provided below: How to make a plot of the Hydraulic Grade Line (HGL) that exists between any two nodes in a network It is often useful to view the hydraulic or energy grade line between two points in a network. This can be easily achieved by using the following few lines of script, (To view the full script that is needed to effect this, open the example file "4 pumps in parallel 3 Operating HGL Plot"). uses Graphics, FFConstants; The uses clause is needed in this example because we make reference to color constants (in Graphics) and to some plot constants defined in FFConstants. The Results Object has a method called ChartFlowPath which will make the plot required. This method requires 4 parameters to be passed when a call is made. Results.ChartFlowPath(DisplaySet, 1, 23, PSIUnitId); // The first parameter DisplaySet tells the method what you wish to display // Possible values for this parameter are // cfpHGL which will plot the Hydraulic Grade Line // cfpEGL which will plot the Energy Grade Line // cfpStagnationPressure which will plot the Stagnation Pressure through the flow path // cfpStaticPressure which will plot the Static Pressure through the flow path // The second parameter represents the start node for the plot // The third parameter represents the end node for the plot // The fourth parameter represents the units of head or pressure you wish to show on the plot. It is possible to make any combination of plots by combining the available plot types into a pascal set. For example DisplaySet := SetOf([cfpHGL, cfpEGL]); will make 2 plots - one HGL and one EGL. The nodes represented by the next two parameters StartNode and EndNode must exist. In addition there MUST be a flowpath between the two nodes specified. FluidFlow automatically detects the route between the nodes. The route followed will be the shortest flow path, if more than one flow path exists. The final parameter PSIUnitId is a constant that represents the unit psi. You can either look up the constant directly from the reference section of this manual or you can use the method GetUnitId from the Units object. psiUnitId := Units.GetUnitId('psi');