Elements not updating in Add-In

Discussion created by jbagley on Sep 14, 2012
Latest reply on Sep 17, 2012 by RJKSolutions

Hello Everyone,   


     I am trying to run the wrapper function GetAttributeValue within a timer elapsed function to monitor an attribute.  However the AFWrapper continues to send back whatever values were present from the start of the program and does not change if the elements are updated.  When I stop and restart the script it loads the proper values.

 //returns a list of all active Sensor States
        public static String[] GetActiveList(string DatabasePath)
            AFWrapper.Wrapper MyWrapper = new AFWrapper.Wrapper();
            string[] mynames = MyWrapper.GetElementNames(DatabasePath);
            int ClrCount = mynames.Length;
            List Activelist = new List();

            for (int i = 0; i < (ClrCount - 1); i++)
                string value = MyWrapper.GetAttributeValueForElement(DatabasePath+@"\" + mynames
, "SensorState");
                if (value == "Active")

            string[] ActiveArray=Activelist.ToArray();
            return ActiveArray.ToArray();

Any ideas why it would not return the current element value?  I monitor the values when debugging and the values AFWrapper reads just stay the same.  


Thanks for any help,




Justin Bagley