2 Replies Latest reply on Oct 15, 2018 7:56 PM by John Messinger

    Update Element Relative Display in Processbook

    vinicius.nascimento

      Hi

      I need to update Element Relative Display the moment I open a display. My display was all built using ERD. Has anyone ever used anything like this using VBA?

       

      thanks

        • Re: Update Element Relative Display in Processbook
          gregor

          Hello Vinicius,

           

          Please accept our apologies for the delay in answering your question.

           

          You would implement your code with the Display_Open() event.

          Are you talking about Module Relative Display (MRD) or Element relative Display (ERD)? The wording is easy to be confused but there is a huge difference between accessing modules in the PI Module Database versus accessing Elements in the Asset Framework.

           

          Can you tell what exactly you like to do?

           

          The forum has some earlier questions and other resources which you may find helpful like the White Paper - A Few PI ProcessBook VBA Tips

          • Re: Update Element Relative Display in Processbook
            John Messinger

            Hi Vinícius,

             

            Yes, this is possible - as Gregor Beck mentioned, you would use the Display_Open() event handler to execute any code immediately upon opening a display.

             

            Further, you indicate that it is an Element Relative Display that you want to update. Are you looking to programmatically change the conext of that display upon opening? If so, yes this is possible. There are many code examples in these forums of working with element context in VBA. If you can be a little more specific as to what you want to do, I'm sure we can point you to a relevant existing code sample.