DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Get information about selected curve in VIEW

Hi everyone,

I am plotting different Waveform channels on the same 2D Axis Systen Area in VIEW, but I don't know how to programmatically get information from it. Basically I would like to get the names or numbers of their respective X Channels and Y Channels when I click on them. Or, the name of the curve might be enough if it contains all of the information I need.

I am using DIAdem 11. I am already using a subroutine that refreshes every time I click somewhere, and it works perfectly, so you just have to focus on this particular problem, the rest is handled.

Thank you !

0 Kudos
Message 1 of 6
(6,635 Views)

I received DIAdem 2012 today ! Joy ! I do not use DIAdem 11 anymore.

Hope that makes my problem easier.

0 Kudos
Message 2 of 6
(6,620 Views)

Hello,

 

I am currently trying to programmatically know what curve is selected at the time the user clicks, but the following code never works:

 

Dim oMyCurve
For Each oMyCurve in DisplaySheet.Areas(1).DisplayObj.Curves
  if (oMyCurve.Selected) then
      MsgBox("a")
  end if
Next

Under DIAdem 11, no error nor message box appears.

Under DIAdenm 2012, the following error appears:"The value 1 is not a value of the enumeration."

I keep on trying to solve out my original problem , but it seems like there is always something unexpected. 😞

0 Kudos
Message 3 of 6
(6,609 Views)

Hi Near,

 

Now that you have DIAdem 2012, you can click on the "Select Curve" icon above the graph and then hover over the curve-- you'll get a tip strip with the Y channel name:

 

DIAdem Curve Info.png

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 6
(6,556 Views)

Hello Brad,

 

thank you for your answer. However, would you know a way to get the string inside that tip strip programmatically (so that I can then work from it) ?

I'm writing scripts for people, my job is to make theirs faster ^^

Thanks !

 

Additionnal comment: also, today is the last day of my internship. That would be kind of any of you if I could get some help quite shortly, from tomorrow on that will not be an issue for me anymore, though your answer will probably be looked for by the one that will replace me ^^

0 Kudos
Message 5 of 6
(6,547 Views)

Hi Near,

 

If you're selecting the curve of interest in VIEW, that should set the Leading Curve for that graph, which you can access this way:

Set Graph = View.ActiveSheet.ActiveArea.DisplayObj
Msg = Msg & Graph.LeadingCurve.XChannelName & vbCRLF
Msg = Msg & Graph.LeadingCurve.YChannelName
MsgBox Msg

 I don't think there's an event for VIEW curve selection, though, so you'll have to fish out the curve info based on some other action, say a cursor movement.  If the curve is using a Y channel that is a waveform, then you'll need to read out the waveform properties from the Y channel to get the X axis information.  Let me know if you need help with that.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(6,535 Views)