|
iTool Programming: Controlling iTools from the IDL Command Line |
|
When you execute an operation in an iTool, the operation will be applied to the currently selected item. You can use the Select method of the IDLitVisualization class to ensure that the correct item is selected.
To select an item, do the following:
For example, suppose you create an iPlot tool with two plot lines, using the following statements:
IPLOT, RANDOMU(seed, 15)*FINDGEN(15) IPLOT, FINDGEN(15), /OVERPLOT
After these statements have been executed, the second (straight) plot line will be selected in the tool. To select the first plot line, you would use the following statements:
idTool = ITGETCURRENT(TOOL=oTool)
plotIDs = oTool->FindIdentifiers('*plot*', /VISUALIZATIONS)
plotObj0 = oTool->GetByIdentifier(plotIDs[0])
plotObj0->Select
To apply the smooth operation to the first plot line (which has now been programmatically selected), setting the value of the SHOW_EXECUTION_UI property to 0 (False), you would use the following statements:
idSmooth = oTool->FindIdentifiers('*smooth', /OPERATIONS)
success = oTool->DoSetProperty(idSmooth, 'SHOW_EXECUTION_UI', 0)
success = oTool->DoAction(idSmooth)
IDL Online Help (March 06, 2007)