From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Plot line Handle selected by cursor in Snap to point mode

Solved!
Go to solution

Hello everyone,

 

I have a graph with multiple plots and a single cursor in Snap to point mode.

 

Since the cursor is in Snap to point mode, is it possible to have the handle of the plot selected by the cursor?

 

 

thanks in advance

 

--

Mattia G.

0 Kudos
Message 1 of 2
(892 Views)
Solution
Accepted by Mattia.G

Tere are several ways to obtain this element.

 

The graph control callback will return an EVENT_COMMIT when a cursor is operated: these data are included:

Graphs All graph commit actions eventData1 = The index of the cursor or the annotation, depending on which one the user moved

eventData2 = VAL_CURSOR or VAL_ANNOTATION, as appropriate to eventData1

From the cursor index you can obtain the plot handle calling GetGraphCursorIndex () function.

 

Otherwise you can directly call GetGraphCursorIndex passing the number of the cursor you are intested to.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(883 Views)