Scope: Schematic editor
Object: Property Object
The Application_ViewDocument event is used in a DataBook script to dynamically build URLs to web pages.
Sub Application_ViewDocument (ByVal arg1 As Object, ByVal arg2 As Object)
A row of properties selected in the Component Search results window.
A property containing the document you want to view.
Applies to the Properties objects (see Property Object), and is called by the script when you click a Web page link and before the document viewer launches, so that it can build a URL.
Enumerated values are not automatically available in a script file, so you must specify the numeric values for this data type (for example, VDM_COMP = 128).
This example launches notepad to view the document specified in the DataBook Document field:
Mentor Graphics recommends that you use COM versioning syntax in script examples that use GetObject and CreateObject. Without COM versioning, the script will access the last installation to which the release switcher pointed.
Function Application_ViewDocument(properties, document)
'
'
set wsh = CreateObject("WScript.Shell")
' Searches path for notepad.exe
wsh.Run("notepad.exe " & "C:\DataSheets\" & document.Value)
' set the document value to empty ("") to prevent DataBook
' from launching the viewer
End Function
You can use directory pointers to point to a central data sheet repository, as shown in the example.