You can simulate it...
Public Sub ShowItemDefinition(TheSymbol As Symbol)
TheSymbol.Selected = True
Dim cb As PBCommandBar
Set cb = Application.CommandBars("Drawing Toolbar")
Dim c As PBCommandBarControl
Set c = cb.FindControl(, 32780) 'Selected Item
(This is from my VBA archives, simple to convert to .Net)
Another way to do this (from my VBA archives) is to use SendKeys. You programmatically set ProcessBook to Run mode, select the symbol, and then use SendKeys to send an Enter command to bring up the definition window:
ThisDisplay.Application.RunMode = False
ThisDisplay.Symbols(sym).Selected = True
SendKeys "~", False
You can easily enough convert this to .Net using the My.Computer.Keyboard.SendKeys method.
Neither of those is particularly 'elegant' but would work. I have since found out though that for this particular item, I don't need to do it anyway. However, there are other areas (multistates) where I might still need something like this so I will probably end up using one of these methods somewhere.
The only elegant way to do this would be for OSIsoft to modify the automation model for ProcessBook, possibly adding a "ShowDefinition" method to the Symbol object.
Good point - you guys presented 2 viable solutions, but there could be a more elegant way if we supported some sort of Symbol.ShowDefinition method. I suggest you contact Tech Support and file this in as an Enhancement Request for PI ProcessBook - they are really the ones to handle this kind of requests...
Don't think I ever got around to submitting this request so I have just done so.
I have found the Symbol.DefineMSProperties() method:
Symbol DefineMSProperties Method
The DefineMSProperties method displays the Multi-State symbol dialog for the user to define the properties of the multi-state symbol.
Boolean. True if user pressed OK on the dialog box.
but when I call it on a child of a composite symbol, it immediately returns false without displaying the dialog. Has anybody got this one to work?
Actually, I have just found issue 18577OSI8 on the Techsupport website:
VBA symbol method DefineMSProperties is not working
Customer Issue: Customer was not able to set multistate properties of a symbol with the DefineMSProperties method in VBA.
Findings: The bug was introduced in ProcessBook 3.0 when migrating from the PI API to the PI SDK. The method call is not coded properly.
Suggested Solution: Properly code the DefineMSProperties method in ProcessBook.
Work Around: Multistate properties of a symbol can be set in VBA by using the MultiState and MSState objects. An example is provided.
So it looks like I will have to re-implement that dialog. Poo.