Python APIs for Calculator Layer Contextual Actions

Getting Started

In order to define a contextual action for calculator layers, you need to put your Python script in your Python directory under a directory called Contextual_XSection_Calculator_Layer.

Go to Tools->Options->Environment->Python Scripts (or Tools->Options->Python->Scripts in INTViewer 5.2) and click "Refresh from Disk". Your script should be listed automatically.

You will now be able to execute this script from the contextual menu of the calculator layer:

This script will change the maximum values of the XSection range to the mouse position.

This script is attached at the bottom of this article.

The result after the script executes should look something like the following (assuming mouse position was at TraceNumber 4068 and Time 1.077):