How to read back Value attribute from an elemen in a case

Discussion created by RobFerguson1 on Oct 2, 2014
Latest reply on Oct 3, 2014 by RobFerguson1

I am using the AF SDK to read Attribute data back from a Case and although I have the right case when I reference the elements it is going to the information in the Elements list for the Model rather than the copy of the Elements in my Case.  


I had assumed that when I code something similar to the fragment below the indexing of "afCase.Elements[]" (line 3) would return the element information from within the Case.


     1                   for (idx = 0; idx < elementLst.Length; idx++)
  2              {
  3                  if ((afElement = afCase.Elements[elementLst[idx]) == null)
  4                  {
  5                      Console.WriteLine(func + ": Warning Msg : Element '" + elementLst[idx] + "' is not defined in Model");
  6                      retState = RCDE.WARN;
  7                  }
  8                  else
  9                  {
  10                      AFAttribute afAttribute = afElement.Attributes["MeasuredMass"];
  11                      values[idx] =  (double) afAttribute.GetValue().Value;
  12                  }
  13              }




Is there an explantion anywhere of why this behaviour is occuring?


Which Element list should I be indexing to get the values from the case attibutes?