AnsweredAssumed Answered

Retrieving attribute values that are outputs from an analytic

Question asked by natdavidson on Jun 22, 2017
Latest reply on Jun 28, 2017 by natdavidson

Using c# and afsdk, I can get to an attribute and typically i can get the value of the attribute using the GetValue() method. With attributes that are PI Point References, it seems this method works just fine, as in you get values that are also reported in PSE. With attributes that are analyses outputs not out putting to a PI Point, GetValue() always returns 0. Is there an overload that i should be using? I've looked at the AFCase overload, I wasn't sure if i implemented it correctly, i still got a 0 using the AFCase overload.

Here is the code i was using to test:


            string teststring1 = @"\\element path string";

            AFElement testElement1 = AFObject.FindObject(teststring1) as AFElement;

            AFAttribute testAttribute = testElement1.Attributes[@"Name of element attribute"];

            AFAnalysis testanalysis = testElement1.Analyses[@"Name of analysis"];

            AFCase testCase = new AFCase(testanalysis);


            AFValue testValue = testAttribute.GetValue(testCase);


Any help on retrieving the analysis value that is output to the attribute would be appreciated.