Skip to main content
OpenTD gives you full control over case sets. You can create, query, modify, run, or delete them. The following sections show how.

Create and run a Case

OpenTD can be used to interact with the Case Set Manager to create and run cases as shown in the following program:
Solution files, including “torchNom.sav” and “torchCold.sav”, will be written to the working directory, which we created and then set with ThermalDesktop.ConnectConfig.StartDirectory. (See the Control how OpenTD connects to Thermal Desktop section for more information about controlling how OpenTD connects to TD.) Otherwise, the working directory would have probably been the directory containing your exe. You can also use the ThermalDesktop.SaveAs method before running to save the dwg and set the working directory.

Create an orbit and apply it to a case set

Orbits are created using the ThermalDesktop.CreateOrbit method. Once created, they are applied to case sets by adding a new item to the CaseSet.RadiationTasks list. This can also be used to add other types of radiation tasks, such as RADK calculations, as shown in the following program:

Run in batch mode

When you call CaseSet.Run(), it is the same as selecting and running a single case in the GUI. If you would like to select multiple cases and run, either in Demand or Batch mode, you can use ThermalDesktop.CaseSetManager. It provides all the functionality of the Case Set Manager, including the ability to adjust Manager-level options, using the CaseSetManager.Options member. To run multiple cases–just like selecting them all in the GUI and running–use the following CaseSetManager.Run overload:
In other words, you provide a List<int> or other IEnumerable<int> containing the indices of the cases you would like to run. These indices correspond to the list indices returned by CaseSetManager.GetCaseSets() or the equivalent ThermalDesktop.GetCaseSets() method.