02-03-2009 08:57 AM
I want to add channels programmatically in a Report sheet. How is this accomplished? I have used the following code but it does not appear to execute the statements I want within the 2-D axis object. I used the standard example commands which paint the background red and this works.
Call GraphSheetShow("Sheet 2")
Call GraphObjOpen("2DAxis1")
D2AxisBackColor = "red"
D2ChnX(1)="X-Channel"
D2ChnY(1)="Y-Channel"
Call GraphObjClose("2DAxis1")
Call PicUpdate
Solved! Go to Solution.
02-03-2009 09:23 AM
Hi Nick Papa
You first have to add a new curve. If you want to create more then one curve you have to use different names like "New_Curve2":
Call PicDelete() 'Deletes all objects
Call GraphObjNew("2D-Axis","New_2DAxis1") 'Creates a new 2D axis system
Call GraphObjOpen("New_2DAxis1") 'Opens the axis object
D2AxisBackColor ="yell." 'Sets the background color
D2AxisTop =10 'Sets the position
D2AxisBottom =10
D2AxisLeft =10
D2AxisRight =10
Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve
Call GraphObjOpen("New_Curve") 'Opens the curve object
D2CCHNX ="[1]/[1]" 'Defines the x-channel
D2CCHNY ="[1]/[2]" 'Defines the y-channel
D2CurveColor ="red" 'Defines the curve color
Call GraphObjClose("New_Curve") 'Closes the curve object
Call GraphObjClose("New_2DAxis1") 'Closes the axis object
Call PicUpdate() 'Updates the report
In the DIAdem help you will find a link from each REPORT variable to a description "Accessing Objects in DIAdem REPORT"
Hope this help
02-03-2009 09:54 AM
02-03-2009 10:19 AM
Hi Nick Papaconstantinou
Remove the first command PicDelete().
If you do not want to create a new axis system you do not need the command GraphobjNew. Use the name of the existing axis system as well. To find aut the name move the mouse over this object. The name will be shown in the status line. Or double click the axis system and press CTRL+A in the definition dialog. DIAdem will copy all parameters into the clipboard. You can paste this text to your script.
Hope this helps!
Winfried
02-03-2009 11:39 AM
Thanks for helping me solve my problem. I now know the mechanism needed to generate the required objects.
![]()