DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem Script : Error occur variable is undefined 'GraphObjNew'

Highlighted
Hello,

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!

 

 

0 Kudos
Message 1 of 4
(422 Views)

Only problem I had with the code was changing

D2CChnXName = XChannel
D2CChnYName = YChannel

To: 

D2CChnXName = XChannel.Name
D2CChnYName = YChannel.Name

 

Otherwise worked

0 Kudos
Message 2 of 4
(393 Views)

I was changing the code 

 

D2CChnXName = XChannel.Name
D2CChnYName = YChannel.Name

 

but, still alert error below

 Variable is undefined : 'GraphObjNew'

0 Kudos
Message 3 of 4
(371 Views)

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

Message 4 of 4
(347 Views)