2 Replies Latest reply on Nov 16, 2016 3:49 PM by exelejames

    Is there an AFSDK PIPoint attributes dialog control?

    exelejames

      Hi!

      I'm sorry if this is something too basic, but I've been searching for about a half-hour without finding what I'm looking for.

      Is there a dialog provided in the AFSDK that displays a PIPoint's attributes (or properties)? I'm seeing one in PI System Explorer:

      I think the PISDK provided a similar dialog, is there one in the AFSDK? Or is the attached dialog available for programmatic use, or is this something I would have to build on my own?

        • Re: Is there an AFSDK PIPoint attributes dialog control?
          jking

          Try the following code in a Windows Form project:

           

              static class Program
              {
                  static PISystems afServers = new PISystems();
                  static PISystem sys;
                  static AFDatabase afDB;
                  static AFElement elem;
                  static AFAttribute attrib;
                  static PIServers srvs = new PIServers();
                  static PIServer srv;
                  static OSIsoft.AF.PI.PIPoint pt;
          
          
                  /// <summary>
                  /// The main entry point for the application.
                  /// </summary>
                  [STAThread]
                  static void Main()
                  {
                      PIPoint pt = PIPoint.FindPIPoint(@"\\kingvmfarm\sinusoid");
                      List<PIPoint> list = new List<PIPoint>();
                      list.Add(pt);
                      if (list == null || list.Count <= 0) return;
                      if (list.Count == 1)
                          AFOperations.ShowProperties(null, list[0], null, null, null, false);
                      else
                          AFOperations.ShowProperties(null, list, null, null, null, false);
          
          
                      Application.EnableVisualStyles();
                      Application.SetCompatibleTextRenderingDefault(false);
                      Application.Run(new Form1());
          
          
                  }
              }
          
          3 of 3 people found this helpful
            • Re: Is there an AFSDK PIPoint attributes dialog control?
              exelejames

              Thank you, Jason!

               

              I'm still wondering why this was so hard for me to find. I'm blaming a combination of user error (ahem), the user not searching through enough example code (ahem, again), difficulty searching the help files, and thinking there might be a forms control similar to the one provided for AF Attributes ("UI.PropertyPage.AFAttributesPage").