attach_plotview_by_name
The attach_plotview_by_name function attaches a plot window from the Mira desktop to a CPlotView object by matching the plot window's title. The new CPlotView object is returned. This is a global function that is not a member of the CPlotView class.
This function is useful for directly selecting a plot window from the Mira desktop without pausing the script to select it from a list. For example, the script might attach a plot window you created with a known title or a window that was created in a previous script. The window title can be saved and retrieved using a text file or the Windows Registry using the CRegistry class.
CPlotView = attach_plotview_by_name( sTitle )
sTitle is the target window title.
On success, a new CPlotView object is returned.
On failure, nil is returned.
The following script attaches a plot window using a target name obtained from the Windows Registry. This name was previous saved under the key "plot window title" after using the CPlotView:SetTitle method to create a unique name. A new CPlotView object is returned if the plot window exists.
|
-- open the registry key "plot stuff" |
|
-- return a window title previously saved |
|
-- attach the named plot window |
|
-- if window was attached... |
|
-- print a success message |
|
|
|
|
|
|
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.