DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Set X Axis Channel Automatically with User Command Script in VIEW

Hi!

 

I'm trying to create a user command script to automatically set the X-Axis of a Curve when a channel is dropped onto a 2D Axis System. All of our channels are in groups and each group has it's own time channel:

 

Capture.PNG

 

Since they are consistently named, it would be really nice to be able to set the X-Axis with a User Command. I have the basic template below (I'm new to DiAdem) but I don't know what methods to use to finish it.

 

Call AddUserCommandToEvent("View.Events.OnDrop", "MyOnDrop")

Sub MyOnDrop(oContext, oDropInformation, ByRef bProceed)
  Set elements = oDropInformation.DIAdemElements
  If oContext.DisplayObjType = "CurveChart2D" Then
    For Each element in elements
      
    Next
  End If
  bProceed = TRUE
End Sub

 Any help would be most appreciated! Thanks!

0 Kudos
Message 1 of 2
(4,301 Views)

Hi Thomas,

 

I've found a knowledge base article that seems to be doing something similar to what you're looking at. It's on the subject of programmatically assigning data channels to a graph object, and can be found here. Additionally, it might be useful to look at this documentation on commands and variables within DIAdem while writing your script. The ChnIndex variable, for example, might be useful to grab the time channel by index and assign it to the plot axis.

 

Regards,

 

 

Regards,

Kristen M

Automated Test Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 2
(4,279 Views)