12-19-2018 07:09 PM
I am new to Diadem and to Script so I am having some trouble creating some very basic code. I am trying to plot curves from data in a DAT file to a graph on a report layout but am getting an error code. I can't figure it out and would be glad if someone could help me out.
Below I have an image of error message and my code. So I use Diadem Evaluation 2018 Version
Thanks!
12-21-2018 10:57 AM
Only problem I had with the code was changing
D2CChnXName = XChannel D2CChnYName = YChannel
To:
D2CChnXName = XChannel.Name
D2CChnYName = YChannel.Name
Otherwise worked
12-26-2018 12:38 AM
I was changing the code
D2CChnXName = XChannel.Name
D2CChnYName = YChannel.Name
but, still alert error below
Variable is undefined : 'GraphObjNew'
01-02-2019 01:06 AM
Hello LHeeYa,
From DIAdem 2018 on the old REPORT API is not support any more. This was announced more than 5 years ago an is part of the DIAdem 2017 readme.
We started with the new REPORT API in DIAdem 2012. It is object oriented and much faster than the old one.
The REPORT part in your script can be changed to the new API as follows:
dim oSheet, o2DAxis, oCurve call Report.LoadLayout("Template") set oSheet = Report.Sheets(1) set o2DAxis = oSheet.Objects.Add(eReportObject2DAxisSystem, "2DAxis1") set oCurve = o2DAxis.Curves2D.Add(e2DShapeLine, "New_Curve") oCurve.Shape.XChannel.Reference = XChannel.GetReference(ExtendChnName) oCurve.Shape.YChannel.Reference = YChannel.GetReference(ExtendChnName)
Greetings
Walter