05-14-2018 08:32 PM
Oups sorry, I missed that info... My bad !
I'll try to figure out something else then 🙂
05-21-2018 04:25 PM
I'm still struggling with this, can anyone help?
05-23-2018 07:14 AM
Have you explored using the GraphObjChnNameGet command? It looks like this should return the name of an object in a report, being a curve in your case.You may be able to loop through the curves in your report to see if the specific one you're looking for already exists, then add the channel maximum from there
05-23-2018 10:31 AM
Some editing is still needed but that should be a good starting point.
05-24-2018 12:25 PM
Can you paste the code into a reply?
05-24-2018 01:04 PM
Sorry, forgot you could not download anything...
'-------------------------------------------------------------------------------
'-- VBS script file
'-- Created on 05/09/2018 13:37:04
'-- Author:
'-- Comment:
'-------------------------------------------------------------------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Data.Root.Clear
Call DataFileLoad(CurrentScriptPath & "EXAMPLE.TDM")
Call REPORT.LoadLayout(CurrentScriptPath & "EXAMPLE.TDR")
Dim oSheet : Set oSheet = REPORT.Sheets("Test")
Dim oChart : Set oChart = oSheet.Objects("Chart")
Dim oCurves : Set oCurves = oChart.Curves2D
Dim oChannels : Set oChannels = Data.Root.ActiveChannelGroup.Channels
Dim channel, oMyCurve, count, curve, name
count = 1
For Each channel In oChannels
For Each curve In oCurves
name = split(curve.Shape.YChannel.Reference, "/")
If(name(1) = channel.Name) Then
Set oMyCurve = oCurves.Add(e2DShapeLine, "New" & count)
oMyCurve.Shape.XChannel.Reference = "[1]/Time"
oMyCurve.Shape.YChannel.Reference = "[1]/" & channel.Name & "_Mean"
End If
Next
count = count + 1
Next
05-29-2018 01:02 PM
Thanks for your help, works great!