DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem add channel programmatically

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(4,814 Views)
Solution
Accepted by topic author Nick Papaconstantinou

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

Message 2 of 5
(4,813 Views)
Thanks for solving my problem.  Now, I would like to know how I can add more channels onto existing without deleting other report pages.
0 Kudos
Message 3 of 5
(4,806 Views)

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

Message 4 of 5
(4,803 Views)

Thanks for helping me solve my problem.  I now know the mechanism needed to generate the required objects.

 

Smiley Happy

0 Kudos
Message 5 of 5
(4,798 Views)