{"id":1092,"date":"2013-04-21T21:31:27","date_gmt":"2013-04-21T18:31:27","guid":{"rendered":"http:\/\/www.water-simulation.com\/wsp\/?p=1092"},"modified":"2014-02-25T09:38:01","modified_gmt":"2014-02-25T06:38:01","slug":"using-epanet-toolkit-in-csharp","status":"publish","type":"post","link":"http:\/\/www.water-simulation.com\/wsp\/2013\/04\/21\/using-epanet-toolkit-in-csharp\/","title":{"rendered":"Using EPANet Toolkit in C#"},"content":{"rendered":"<p><span style=\"color: #ff0000;\"><strong>Update 24\/02\/2014:<\/strong><\/span> <span style=\"color: #0000ff;\">there is new EPANET C# class <a href=\"http:\/\/www.water-simulation.com\/wsp\/2014\/02\/25\/epanet-class-for-c-sharp\/\"><span style=\"color: #0000ff;\">here<\/span><\/a>.<\/span><\/p>\n<p>Thanks to <a href=\"http:\/\/www.abcprogramlama.com\/2011\/03\/12\/pinvoke-epanet2-dll\/\">abcprogramlama<\/a>\u00a0(site in Turkish)\u00a0I finally got the EPANet Toolkit working in C# (C-sharp).\u00a0First the EpanetCSharpLibrary\u00a0should be added to the solution (click to expend or download <a href=\"http:\/\/www.water-simulation.com\/wsp\/wp-content\/uploads\/2013\/04\/EpanetCSharpLibrary.zip\">here<\/a>):<\/p>\n<p>[code language=&#8221;csharp&#8221; collapse=&#8221;true&#8221;]<br \/>\nusing System;<br \/>\nusing System.Runtime.InteropServices;<\/p>\n<p>namespace EpanetCSharpLibrary<br \/>\n{<br \/>\n public static class Epanet<br \/>\n {<br \/>\n public const string EPANETDLL = &quot;epanet2.dll&quot;;<br \/>\n public const int EN_ELEVATION = 0;<br \/>\n public const int EN_BASEDEMAND = 1;<br \/>\n public const int EN_PATTERN = 2;<br \/>\n public const int EN_EMITTER = 3;<br \/>\n public const int EN_INITQUAL = 4;<br \/>\n public const int EN_SOURCEQUAL = 5;<br \/>\n public const int EN_SOURCEPAT = 6;<br \/>\n public const int EN_SOURCETYPE = 7;<br \/>\n public const int EN_TANKLEVEL = 8;<br \/>\n public const int EN_DEMAND = 9;<br \/>\n public const int EN_HEAD = 10;<br \/>\n public const int EN_PRESSURE = 11;<br \/>\n public const int EN_QUALITY = 12;<br \/>\n public const int EN_SOURCEMASS = 13;<br \/>\n public const int EN_INITVOLUME = 14;<br \/>\n public const int EN_MIXMODEL = 15;<br \/>\n public const int EN_MIXZONEVOL = 16;<br \/>\n public const int EN_TANKDIAM = 17;<br \/>\n public const int EN_MINVOLUME = 18;<br \/>\n public const int EN_VOLCURVE = 19;<br \/>\n public const int EN_MINLEVEL = 20;<br \/>\n public const int EN_MAXLEVEL = 21;<br \/>\n public const int EN_MIXFRACTION = 22;<br \/>\n public const int EN_TANK_KBULK = 23;<br \/>\n public const int EN_DIAMETER = 0;<br \/>\n public const int EN_LENGTH = 1;<br \/>\n public const int EN_ROUGHNESS = 2;<br \/>\n public const int EN_MINORLOSS = 3;<br \/>\n public const int EN_INITSTATUS = 4;<br \/>\n public const int EN_INITSETTING = 5;<br \/>\n public const int EN_KBULK = 6;<br \/>\n public const int EN_KWALL = 7;<br \/>\n public const int EN_FLOW = 8;<br \/>\n public const int EN_VELOCITY = 9;<br \/>\n public const int EN_HEADLOSS = 10;<br \/>\n public const int EN_STATUS = 11;<br \/>\n public const int EN_SETTING = 12;<br \/>\n public const int EN_ENERGY = 13;<br \/>\n public const int EN_DURATION = 0;<br \/>\n public const int EN_HYDSTEP = 1;<br \/>\n public const int EN_QUALSTEP = 2;<br \/>\n public const int EN_PATTERNSTEP = 3;<br \/>\n public const int EN_PATTERNSTART = 4;<br \/>\n public const int EN_REPORTSTEP = 5;<br \/>\n public const int EN_REPORTSTART = 6;<br \/>\n public const int EN_RULESTEP = 7;<br \/>\n public const int EN_STATISTIC = 8;<br \/>\n public const int EN_PERIODS = 9;<br \/>\n public const int EN_NODECOUNT = 0;<br \/>\n public const int EN_TANKCOUNT = 1;<br \/>\n public const int EN_LINKCOUNT = 2;<br \/>\n public const int EN_PATCOUNT = 3;<br \/>\n public const int EN_CURVECOUNT = 4;<br \/>\n public const int EN_CONTROLCOUNT = 5;<br \/>\n public const int EN_JUNCTION = 0;<br \/>\n public const int EN_RESERVOIR = 1;<br \/>\n public const int EN_TANK = 2;<br \/>\n public const int EN_CVPIPE = 0;<br \/>\n public const int EN_PIPE = 1;<br \/>\n public const int EN_PUMP = 2;<br \/>\n public const int EN_PRV = 3;<br \/>\n public const int EN_PSV = 4;<br \/>\n public const int EN_PBV = 5;<br \/>\n public const int EN_FCV = 6;<br \/>\n public const int EN_TCV = 7;<br \/>\n public const int EN_GPV = 8;<br \/>\n public const int EN_NONE = 0;<br \/>\n public const int EN_CHEM = 1;<br \/>\n public const int EN_AGE = 2;<br \/>\n public const int EN_TRACE = 3;<br \/>\n public const int EN_CONCEN = 0;<br \/>\n public const int EN_MASS = 1;<br \/>\n public const int EN_SETPOINT = 2;<br \/>\n public const int EN_FLOWPACED = 3;<br \/>\n public const int EN_CFS = 0;<br \/>\n public const int EN_GPM = 1;<br \/>\n public const int EN_MGD = 2;<br \/>\n public const int EN_IMGD = 3;<br \/>\n public const int EN_AFD = 4;<br \/>\n public const int EN_LPS = 5;<br \/>\n public const int EN_LPM = 6;<br \/>\n public const int EN_MLD = 7;<br \/>\n public const int EN_CMH = 8;<br \/>\n public const int EN_CMD = 9;<br \/>\n public const int EN_TRIALS = 0;<br \/>\n public const int EN_ACCURACY = 1;<br \/>\n public const int EN_TOLERANCE = 2;<br \/>\n public const int EN_EMITEXPON = 3;<br \/>\n public const int EN_DEMANDMULT = 4;<br \/>\n public const int EN_LOWLEVEL = 0;<br \/>\n public const int EN_HILEVEL = 1;<br \/>\n public const int EN_TIMER = 2;<br \/>\n public const int EN_TIMEOFDAY = 3;<br \/>\n public const int EN_AVERAGE = 1;<br \/>\n public const int EN_MINIMUM = 2;<br \/>\n public const int EN_MAXIMUM = 3;<br \/>\n public const int EN_RANGE = 4;<br \/>\n public const int EN_MIX1 = 0;<br \/>\n public const int EN_MIX2 = 1;<br \/>\n public const int EN_FIFO = 2;<br \/>\n public const int EN_LIFO = 3;<br \/>\n public const int EN_NOSAVE = 0;<br \/>\n public const int EN_SAVE = 1;<br \/>\n public const int EN_INITFLOW = 10;<\/p>\n<p>#region Epanet Imports<br \/>\n public delegate void UserSuppliedFunction(string param0);<br \/>\n \/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Runs a complete EPANET simulation.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;f1&quot;&gt;name of the input file&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;f2&quot;&gt;name of an output report file&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;f3&quot;&gt;name of an output output file &lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;vfunc&quot;&gt;pointer to a user-supplied function which accepts a character string as its argument&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;Returns an error code.&lt;\/returns&gt;<br \/>\n [DllImport(EPANETDLL, EntryPoint = &quot;ENepanet&quot;)]<br \/>\n public static extern int ENepanet(string f1, string f2, string f3, UserSuppliedFunction vfunc);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Opens the Toolkit to analyze a particular distribution system.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;param0&quot;&gt;name of the input file&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;param1&quot;&gt;name of an output report file&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;param2&quot;&gt;name of an output output file&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;Returns an error code.&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENopen&quot;)]<br \/>\n public static extern int ENopen(string param0, string param1, string param2);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Writes all current network input data to a file using the format of an EPANET input file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;filename&quot;&gt;name of the file where data is saved.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsaveinpfile&quot;)]<br \/>\n public static extern int ENsaveinpfile(string filename);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Closes down the Toolkit system (including all files being processed).<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENclose&quot;)]<br \/>\n public static extern int ENclose();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Runs a complete hydraulic simulation with results<br \/>\n \/\/\/ for all time periods written to the binary Hydraulics file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsolveH&quot;)]<br \/>\n public static extern int ENsolveH();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Transfers results of a hydraulic simulation from the binary Hydraulics file to the binary Output file,<br \/>\n \/\/\/ where results are only reported at uniform reporting intervals.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsaveH&quot;)]<br \/>\n public static extern int ENsaveH();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Opens the hydraulics analysis system.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENopenH&quot;)]<br \/>\n public static extern int ENopenH();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Initializes storage tank levels, link status and settings,<br \/>\n \/\/\/ and the simulation clock time prior to running a hydraulic analysis.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;saveflag&quot;&gt;0-1 flag indicating if hydraulic results will be saved to the hydraulics file.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENinitH&quot;)]<br \/>\n public static extern int ENinitH(int saveflag);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Runs a single period hydraulic analysis, retrieving the current simulation clock time t.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;t&quot;&gt;current simulation clock time in seconds.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENrunH&quot;)]<br \/>\n public static extern int ENrunH(ref long t);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Determines the length of time until the next hydraulic event occurs in an extended period simulation.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tstep&quot;&gt;time (in seconds) until next hydraulic event occurs or<br \/>\n \/\/\/ 0 if at the end of the simulation period.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENnextH&quot;)]<br \/>\n public static extern int ENnextH(ref long tstep);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Closes the hydraulic analysis system, freeing all allocated memory.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENcloseH&quot;)]<br \/>\n public static extern int ENcloseH();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Saves the current contents of the binary hydraulics file to a file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;fname&quot;&gt;name of the file where the hydraulics results should be saved.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsavehydfile&quot;)]<br \/>\n public static extern int ENsavehydfile(string fname);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Uses the contents of the specified file as the current binary hydraulics file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;fname&quot;&gt;name of the file containing hydraulic analysis results for the current network.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENusehydfile&quot;)]<br \/>\n public static extern int ENusehydfile(string fname);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Runs a complete water quality simulation with results at uniform reporting<br \/>\n \/\/\/ intervals written to EPANET&#8217;s binary Output file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsolveQ&quot;)]<br \/>\n public static extern int ENsolveQ();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Opens the water quality analysis system.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENopenQ&quot;)]<br \/>\n public static extern int ENopenQ();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Initializes water quality and the simulation clock time prior to running a water quality analysis.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;saveflag&quot;&gt;0-1 flag indicating if analysis results<br \/>\n \/\/\/ should be saved to EPANET&#8217;s binary output file at uniform reporting periods.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot; ENinitQ&quot;)]<br \/>\n public static extern int ENinitQ(int saveflag);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Makes available the hydraulic and water quality results that occur<br \/>\n \/\/\/ at the start of the next time period of a water quality analysis,<br \/>\n \/\/\/ where the start of the period is returned in t.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;t&quot;&gt;current simulation clock time in seconds.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENrunQ&quot;)]<br \/>\n public static extern int ENrunQ(ref long t);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Advances the water quality simulation to the start of the next hydraulic time period.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tstep&quot;&gt;time (in seconds) until next hydraulic event occurs or<br \/>\n \/\/\/ 0 if at the end of the simulation period.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENnextQ&quot;)]<br \/>\n public static extern int ENnextQ(ref long tstep);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Advances the water quality simulation one water quality time step.<br \/>\n \/\/\/ The time remaining in the overall simulation is returned in tleft.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tleft&quot;&gt;seconds remaining in the overall simulation duration.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENstepQ&quot;)]<br \/>\n public static extern int ENstepQ(ref long tleft);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Closes the water quality analysis system, freeing all allocated memory.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENcloseQ&quot;)]<br \/>\n public static extern int ENcloseQ();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Writes a line of text to the EPANET report file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;line&quot;&gt;text to be written to file.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENwriteline&quot;)]<br \/>\n public static extern int ENwriteline(string line);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Writes a formatted text report on simulation results to the Report file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENreport&quot;)]<br \/>\n public static extern int ENreport();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Clears any report formatting commands that either appeared in the<br \/>\n \/\/\/ [REPORT] section of the EPANET Input file or were issued with the ENsetreport function.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENresetreport&quot;)]<br \/>\n public static extern int ENresetreport();<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Issues a report formatting command.<br \/>\n \/\/\/ Formatting commands are the same as used in the<br \/>\n \/\/\/ [REPORT] section of the EPANET Input file.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;command&quot;&gt;text of a report formatting command.&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetreport&quot;)]<br \/>\n public static extern int ENsetreport(string command);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the parameters of a simple control statement.<br \/>\n \/\/\/ The index of the control is specified in cindex and<br \/>\n \/\/\/ the remaining arguments return the control&#8217;s parameters.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;cindex&quot;&gt;control statement index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;ctype&quot;&gt;control type code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;lindex&quot;&gt;index of link being controlled&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;setting&quot;&gt;value of the control setting&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;nindex&quot;&gt;index of controlling node&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;level&quot;&gt;value of controlling water level or<br \/>\n \/\/\/ pressure for level controls or of time of control action (in seconds)<br \/>\n \/\/\/ for time-based controls&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetcontrol&quot;)]<br \/>\n public static extern int ENgetcontrol(int cindex, ref int ctype, ref int lindex,<br \/>\n ref float setting, ref int nindex, ref float level);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the number of network components of a specified type.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;countcode&quot;&gt;component code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;count&quot;&gt;number of countcode components in the network&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetcount&quot;)]<br \/>\n public static extern int ENgetcount(int countcode, ref int count);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the value of a particular analysis option.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;optioncode&quot;&gt;an option code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;an option value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetoption&quot;)]<br \/>\n public static extern int ENgetoption(int optioncode, ref float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the value of a specific analysis time parameter.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;time parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;timevalue&quot;&gt;value of time parameter in seconds&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgettimeparam&quot;)]<br \/>\n public static extern int ENgettimeparam(int paramcode, ref int timevalue);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves a code number indicating the units used to express all flow rates.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;unitscode&quot;&gt;value of a flow units code number&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetflowunits&quot;)]<br \/>\n public static extern int ENgetflowunits(ref int unitscode);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the index of a particular time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;pattern ID label&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetpatternindex&quot;)]<br \/>\n public static extern int ENgetpatternindex(string id, ref int index);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the ID label of a particular time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;ID label of pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetpatternid&quot;)]<br \/>\n public static extern int ENgetpatternid(int index, string id);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the number of time periods in a specific time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;len&quot;&gt;number of time periods in the pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetpatternlen&quot;)]<br \/>\n public static extern int ENgetpatternlen(int index, ref int len);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the multiplier factor for a specific time period in a time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;time pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;period&quot;&gt;period within time pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;multiplier factor for the period&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetpatternvalue&quot;)]<br \/>\n public static extern int ENgetpatternvalue(int index, int period, ref float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the type of water quality analysis called for.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;qualcode&quot;&gt;water quality analysis code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tracenode&quot;&gt;index of node traced in a source tracing analysis&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetqualtype&quot;)]<br \/>\n public static extern int ENgetqualtype(ref int qualcode, ref int tracenode);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the text of the message associated with a particular error or warning code.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;errcode&quot;&gt;error or warning code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;errmsg&quot;&gt;text of the error or warning message for errcode&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;nchar&quot;&gt;maximum number of characters that errmsg can hold&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgeterror&quot;)]<br \/>\n public static extern int ENgeterror(int errcode, string errmsg, int nchar);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the index of a node with a specified ID.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;node ID label&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;node index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetnodeindex&quot;)]<br \/>\n public static extern int ENgetnodeindex(string id, ref int index);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the ID label of a node with a specified index<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;node index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;ID label of node&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetnodeid&quot;)]<br \/>\n public static extern int ENgetnodeid(int index, string id);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the node-type code for a specific node.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;node index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;typecode&quot;&gt;node-type code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetnodetype&quot;)]<br \/>\n public static extern int ENgetnodetype(int index, ref int typecode);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the value of a specific link parameter.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;node index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;parameter value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetnodevalue&quot;)]<br \/>\n public static extern int ENgetnodevalue(int index, int paramcode, ref float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the index of a link with a specified ID.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;link ID label&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetlinkindex&quot;)]<br \/>\n public static extern int ENgetlinkindex(string id, ref int index);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the ID label of a link with a specified index.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;ID label of link&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetlinkid&quot;)]<br \/>\n public static extern int ENgetlinkid(int index, string id);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the link-type code for a specific link.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;typecode&quot;&gt;link-type code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetlinktype&quot;)]<br \/>\n public static extern int ENgetlinktype(int index, ref int typecode);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the indexes of the end nodes of a specified link.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;fromnode&quot;&gt;index of node at start of link&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tonode&quot;&gt;index of node at end of link&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetlinknodes&quot;)]<br \/>\n public static extern int ENgetlinknodes(int index, ref int fromnode, ref int tonode);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves the value of a specific link parameter.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;parameter value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetlinkvalue&quot;)]<br \/>\n public static extern int ENgetlinkvalue(int index, int paramcode, ref float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Retrieves version.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;version&quot;&gt;Version&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENgetversion&quot;)]<br \/>\n public static extern int ENgetversion(ref int version);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the parameters of a simple control statement.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;cindex&quot;&gt;control statement index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;ctype&quot;&gt;control type code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;lindex&quot;&gt;index of link being controlled&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;setting&quot;&gt;value of the control setting&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;nindex&quot;&gt;index of controlling node&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;level&quot;&gt;value of controlling water level or pressure<br \/>\n \/\/\/ for level controls or of time of control action (in seconds)<br \/>\n \/\/\/ for time-based controls&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetcontrol&quot;)]<br \/>\n public static extern int ENsetcontrol(int cindex, int ctype, int lindex,<br \/>\n float setting, int nindex, float level);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the value of a parameter for a specific node.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;node index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;parameter value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetnodevalue&quot;)]<br \/>\n public static extern int ENsetnodevalue(int index, int paramcode, float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the value of a parameter for a specific link.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;link index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;parameter value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetlinkvalue&quot;)]<br \/>\n public static extern int ENsetlinkvalue(int index, int paramcode, float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Adds a new time pattern to the network.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;id&quot;&gt;ID label of pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENaddpattern&quot;)]<br \/>\n public static extern int ENaddpattern(string id);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets all of the multiplier factors for a specific time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;time pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;factors&quot;&gt;multiplier factors for the entire pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;nfactors&quot;&gt;number of factors in the pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetpattern&quot;)]<br \/>\n public static extern int ENsetpattern(int index, float[] factors, int nfactors);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the multiplier factor for a specific period within a time pattern.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;index&quot;&gt;time pattern index&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;period&quot;&gt;period within time pattern&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;multiplier factor for the period&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetpatternvalue&quot;)]<br \/>\n public static extern int ENsetpatternvalue(int index, int period, float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the value of a time parameter.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;paramcode&quot;&gt;time parameter code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;timevalue&quot;&gt;value of time parameter in seconds&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsettimeparam&quot;)]<br \/>\n public static extern int ENsettimeparam(int paramcode, long timevalue);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the value of a particular analysis option.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;optioncode&quot;&gt;an option code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;value&quot;&gt;an option value&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetoption&quot;)]<br \/>\n public static extern int ENsetoption(int optioncode, float value);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the level of hydraulic status reporting.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;statuslevel&quot;&gt;level of status reporting&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetstatusreport&quot;)]<br \/>\n public static extern int ENsetstatusreport(int statuslevel);<\/p>\n<p>\/\/\/ &lt;summary&gt;<br \/>\n \/\/\/ Sets the type of water quality analysis called for.<br \/>\n \/\/\/ &lt;\/summary&gt;<br \/>\n \/\/\/ &lt;param name=&quot;qualcode&quot;&gt;water quality analysis code&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;chemname&quot;&gt;name of the chemical being analyzed&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;chemunits&quot;&gt;units that the chemical is measured in&lt;\/param&gt;<br \/>\n \/\/\/ &lt;param name=&quot;tracenode&quot;&gt;ID of node traced in a source tracing analysis&lt;\/param&gt;<br \/>\n \/\/\/ &lt;returns&gt;&lt;\/returns&gt;<br \/>\n [DllImportAttribute(EPANETDLL, EntryPoint = &quot;ENsetqualtype&quot;)]<br \/>\n public static extern int ENsetqualtype(int qualcode, string chemname, string chemunits, string tracenode);<\/p>\n<p>#endregion<br \/>\n }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>Now the EPANet class can be used:<\/p>\n<p>[code language=&#8221;csharp&#8221; collapse=&#8221;false&#8221;]<br \/>\npublic static void Main()<br \/>\n    {<br \/>\n        int i = 0;<br \/>\n        int v = 0;<br \/>\n        string f1=&quot;&quot;, f2=&quot;&quot;, f3=&quot;&quot;;<br \/>\n        \/\/get the DLL&#8217;s version<br \/>\n        i = Epanet.ENgetversion(ref v);<\/p>\n<p>        f1 = &quot;Net1.inp&quot;;<br \/>\n        f2 = &quot;out.txt&quot;;<br \/>\n        f3 = &quot;rep.txt&quot;;<br \/>\n        \/\/run an EPANet simulation<br \/>\n        i = Epanet.ENepanet(f1, f2, f3, null);<br \/>\n     }<br \/>\n[\/code]<\/p>\n<p>Turns out to be simple&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update 24\/02\/2014: there is new EPANET C# class here. Thanks to abcprogramlama\u00a0(site in Turkish)\u00a0I finally got the EPANet Toolkit working in C# (C-sharp).\u00a0First the EpanetCSharpLibrary\u00a0should be added to the solution (click to expend or download here): [code language=&#8221;csharp&#8221; collapse=&#8221;true&#8221;] using &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.water-simulation.com\/wsp\/2013\/04\/21\/using-epanet-toolkit-in-csharp\/\"> <span class=\"screen-reader-text\">Using EPANet Toolkit in C#<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[158,159],"class_list":["post-1092","post","type-post","status-publish","format-standard","hentry","category-epanet-related","category-programming","tag-c","tag-csharp"],"_links":{"self":[{"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/posts\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/comments?post=1092"}],"version-history":[{"count":2,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/posts\/1092\/revisions"}],"predecessor-version":[{"id":1289,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/posts\/1092\/revisions\/1289"}],"wp:attachment":[{"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/media?parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/categories?post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.water-simulation.com\/wsp\/wp-json\/wp\/v2\/tags?post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}