aldorexbraam

AFAttributeList.GetValue(timespan)

Discussion created by aldorexbraam on Feb 27, 2012
Latest reply on Feb 28, 2012 by aldorexbraam

Hi, 

 

I am trying to fetch attribute values for multiple attrbutes in one go....

 

reading the documentation the AFAttributeList.GetValue(timespan) is made for that....

 

only problem is that is does only return a list of current value in the AFValues object and not a List<AFvalues> with an AFValues object for each attribute in the list. 

 

The documentation and also previous postings in the forum hint that it should work as I expect but even using the standard PI data reference it does not yield the expected results

 
private static void Objective(AFAttributeList attListt, AFTimeRange timerange)
{
    foreach (AFAttribute att in attListt)
    {
        AFValues vals = att.GetValues(timerange, 0, null);
        // Do something with the values
    }
}

private static void Optimized(AFAttributeList attListt, AFTimeRange timerange)
{
    List vals = attListt.GetValue(timerange);

    foreach (AFValues v well in vals)
    {
        // Do something with the values
    }
}

 

Outcomes