Are you referring to the unit system for a simulation case (which will be either Field or Metric)?
I’m afraid that ‘Simulation Units’ are not exposed via the Ocean API.
You can however test whether each (exported) Simulation Case is FIELD or METRIC by examining the presence of the FIELD or METRIC keyword in the ECLIPSE deck.
The following snippet will run through the Cases and output whether they are FIELD or METRIC.
using (ITransaction trans = DataManager.NewTransaction())
{
SimulationRoot SimRoot = SimulationRoot.Get(PetrelProject.PrimaryProject);
foreach (Case Case in SimRoot.Cases)
{
EclipseKeywordEditor editor = SimulationSystem.CreateEclipseKeywordEditor(Case);
trans.Lock(editor);
foreach (EclipseKeyword keyword in editor.Sections.RunSpec.GetAll("FIELD"))
{
// found FIELD keyword
PetrelLogger.InfoOutputWindow(String.Format("### Case {0} is FIELD", Case.Name));
}
foreach (EclipseKeyword keyword in editor.Sections.RunSpec.GetAll("METRIC"))
{
// found METRIC keyword
PetrelLogger.InfoOutputWindow(String.Format("### Case {0} is METRIC", Case.Name));
}
}
trans.Commit();
}