07-26-2013 04:52 AM
Hi,
I am new to DIAdem, I have been struggling for too long so I have decided to ask for some help, I hope someone can help me.
I am writing a script to plot a graph and add axis labels, Legend and Title.
So far I have just been able to draw the graph but no success with the rest. I have found a few answers to my question but none of them work, I don't know why. I am using Diadem 2012 and this is my code:
Can someone tell me how I make the changes I need?
Thanks
Call PicDelete() 'Deletes all objects. Without this I won't show the curve but with it it deletes the Picloaded previously
Call GraphObjNew("2D-Axis","New_2DAxis") 'Creates a new 2D axis system
Call GraphObjOpen("New_2DAxis") 'Opens the axis object
D2AxisTop =25 'Sets the position
D2AxisBottom =30
D2AxisLeft =20
D2AxisRight =30
Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve
Call GraphObjOpen("New_Curve") 'Opens the curve object
D2CCHNX ="Y_Accel" 'Defines the x-channel
D2CCHNY ="Strg_Angle" 'Defines the y-channel
D2CurveColor ="red" 'Defines the curve color
Call GraphObjClose("New_Curve") 'Closes the curve object
Call GraphObjClose("New_2DAxis") 'Closes the axis object
Call Picupdate
07-26-2013 10:20 AM
Hi Leillo
If you are using DIAdem 2012 you should use the new API. To get a starting point create the layout as you like and then open the corresponding dialog box and press CTRL-Shift-C. Then you have a lot of code in your clipboard, which you can past in you script editor and edit. The contents of the clipboard depends of the dialog box you opened.
You can also select an object in Report and press CTRL-Shift-C
For the new API you will also find tons of small scripts in the help, which shows you how to create labels, legend and titles:
Hope this helps
Winfried
07-29-2013 10:11 AM
Thanks Winfried