You are currently reviewing an older revision of this page.
After setting up WaterObjects.NET in HAMMER to adjust parameters, then run the HAMMER engine and extract data, it only seems to work once. The looping procedure is not allowing for subsequent runs.
The problem was that the output file for the HAMMER engine weren’t closed after retrieving the results. The second time the engine tried to run it complained the output file was in use.
When using the TransientResultsProjectContext class, you need to make sure it gets properly disposed before attempting to access HAMMER results via result fields or if you run the HAMMER engine after using the class. To dispose the class, call the methods ResetHOFResultsDictionary and ResetHMRREsultsDictionary methods passing in true for the parameter. Internally this will close any open HAMMER result files that were opened when using the class. The class does not implement IDispose so calling these two methods is important to avoid any “file in use” issues that may occurs.