DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem For Loop to plot curves from different Data groups

Solved!
Go to solution

Hi, I have 28 tests (28 data groups and 28 curves) that I would like to be able to plot by a For Loop-script.

 

I thought that I could replace [1] with the variable [i] and make a loop like the proposal below but it does not work.


Dim i
For i = 1 to 28
Report.ActiveSheet.Objects.Item("2DAxis1").Curves2D.Item(i).Shape.XChannel.Reference = "[i]/Time"
Report.ActiveSheet.Objects.Item("2DAxis1").Curves2D.Item(i).Shape.YChannel.Reference = "[i]/Acceleration"

Next

 

Does anyone have a solution for this?

/Mike

0 Kudos
Message 1 of 3
(808 Views)
Solution
Accepted by topic author Mike_77

Hi Mike_77,

Please try this:

Dim i
For i = 1 to 28
  Report.ActiveSheet.Objects.Item("2DAxis1").Curves2D.Item(i).Shape.XChannel.Reference = "[" & str(i) & "]/Time"
  Report.ActiveSheet.Objects.Item("2DAxis1").Curves2D.Item(i).Shape.YChannel.Reference = "[" & str(i) & "]/Acceleration"
Next

Greetings

Walter

Message 2 of 3
(798 Views)

Thank you, it worked!

0 Kudos
Message 3 of 3
(775 Views)