3 Replies Latest reply on May 7, 2010 11:17 AM by andreas

    Transfer selected module from one pdi page to another

    sunie

      I need some idea here.

       

      Im now doing the automated PB graphic using module database. Every time user click on the Available Modules such as Well Name. The tags indide the graphic will change accordingly. Those tags i receive from alias and property.

       

      I have an automated graphic using the MDB. One of the automated graphic have link to another automated graphic. To connect to B graphic, i have a button in A graphic. The problem is, when user click the Well Name (at Available Modules) at A graphic then how can i transfer the same selected Well Name in graphic A to be selected in Available Modules in graphic B.

       

      How to select the same Well Name in graphic A to graphic B?

       

      Example: if i select the BRC platform on Graphic A then i click the button MPFM, at the graphic B should also select BRC.

       

      Graphic A

       

      5_2D00_7_2D00_2010-11_2D00_28_2D00_18-AM.png

       

      Graphic B

       

      5_2D00_7_2D00_2010-11_2D00_29_2D00_18-AM.png

          • Re: Transfer selected module from one pdi page to another
            sunie

            Thanks, i will try to use that one. i read that post before. i just not sure whether my problem its same.

             

            Thanks.

              • Re: Transfer selected module from one pdi page to another
                andreas

                here is a stripped down code that simply passes the context down:

                ' This will hold the absolute path to the display,
                ' exluding fileame
                Dim myPath As String

                ' Get the path from this display, excluding filename
                myPath = ThisDisplay.Path
                myPath = Left(myPath, InStrRev(myPath, "\", -1, vbTextCompare))

                ' Get the current display
                Dim myParentDisplay As Display
                Set myParentDisplay = ThisDisplay

                ' The Contexthandlers
                Dim MrdContextHandler As ContextHandler
                Set MrdContextHandler = Application.ContextHandlers("ModuleContext")
                Dim AliasContextHandler As ContextHandler
                Set AliasContextHandler = Application.ContextHandlers("Alias")
                Dim PropContextHandler As ContextHandler
                Set PropContextHandler = Application.ContextHandlers("Property")

                ' This will be the Child Display
                Dim myChildDisplay As Display
                ' Open the Childdisplay
                Set myChildDisplay = Application.Displays.Open(myPath & "ChildDisplay.PDI", True)

                ' Set all three contexthandlers to have thesame context in Child and Parent
                MrdContextHandler.CurrentContext(myChildDisplay) = _
                        MrdContextHandler.CurrentContext(myParentDisplay)
                AliasContextHandler.CurrentContext(myChildDisplay) = _
                        AliasContextHandler.CurrentContext(myParentDisplay)
                PropContextHandler.CurrentContext(myChildDisplay) = _
                        PropContextHandler.CurrentContext(myParentDisplay)