2027 Method
Changes 0
M

SpatialFieldManager.RegisterResult

Description:
Registers result and assigns it a unique result index
public int RegisterResult(
	AnalysisResultSchema resultSchema
)
Return Value Int32 Unique index assigned to the result
// register a new result schema only if one with the same name does not already exist
IList<int> registeredResults = new List<int>();
AnalysisResultSchema resultSchema = new AnalysisResultSchema("Reactions", "Reaction Forces at Column Base");
registeredResults = spatialFieldManager.GetRegisteredResults();
int resultIndex = 999;
foreach (int myInt in registeredResults)
{
   if (spatialFieldManager.GetResultSchema(myInt).Name == "Reactions")
   {
      resultIndex = myInt;
      break;
   }
}
if (resultIndex == 999) // there are existing registered results, but none are named "Reactions"
   resultIndex = spatialFieldManager.RegisterResult(resultSchema);