telventaustralia

How to find out Active Process Book and Active Display from .Net VB Code?

Discussion created by telventaustralia on Jun 17, 2009
Latest reply on Jun 18, 2009 by RJKSolutions

Hi. I am trying to find out active Process Book from .NET VB code, but do not know how to initialize the object. For example, I want to find out the active process book to open some existing schematic or want to display some trend on the active process Book and active display. I am using the following code, but do not know how to initialize the object.

Dim objPB As PBObjLib.Application

'(How/what to initialize?)
objPB = ??
MsgBox(objPB.ActiveProcessBook.Title.ToString)

'I am using following command to open existing PDI file
objPB.Displays.Open("Actual Path", 1)
objPB.ActiveDisplay.SelectedSymbols.Item(1).AddTrace(sTraceName)

Now my question: Am I using correct class object to find out the active process book and active display from .NET VB code. I am using OSIsoft PB add-in template VB code and trying to achieve this from there. Is there any better way we can achieve this? Thanks.

Outcomes