07-04-2013 07:21 AM
Hi everyone,
I am currently working with DIAdem and I would have some newbie questions.
Call PicLoad("Template") Call GraphObjNew("2D-Axis","2DAxis1") Call GraphObjOpen("2DAxis1") Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve Call GraphObjOpen("New_Curve") 'Opens the curve object D2CChnYName = "GroupName/ChannelName" Call GraphObjClose("New_Curve") D2AXISTOP = 9 D2AXISBOTTOM = 40 D2AXISLEFT = 15 D2AXISRIGHT = 40 Call GraphObjClose("2DAxis1") Call PicUpdate
When I copy paste this twice and change the Channel Name, the previous plot is erased by the new plot. Would you know how to fix this?
Also I was wondering how to change the marker. By mouse it is possible to select the cross marker but I do not know how to do it by script. The only thing I know is that I should put "cross" somewhere, but have no idea of the right command.
Solved! Go to Solution.
07-05-2013 07:01 AM
Bump.
I am not interested in placing the second plot next to the first one, but in placing the second courb in the first plot, with the first courb.
I hope someone will help me out !
07-05-2013 08:00 AM - edited 07-05-2013 08:02 AM
Call PicLoad("Template") Call GraphObjNew("2D-Axis","2DAxis1") Call GraphObjOpen("2DAxis1") Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve Call GraphObjOpen("New_Curve") 'Opens the curve object D2CChnYName = "GroupName/ChannelName" Call GraphObjClose("New_Curve") Call GraphObjNew("2D-Curve","New_Curve2") 'Creates a new curve Call GraphObjOpen("New_Curve2") 'Opens the curve object D2CChnYName = "GroupName/ChannelName2" Call GraphObjClose("New_Curve2") D2AXISTOP = 9 D2AXISBOTTOM = 40 D2AXISLEFT = 15 D2AXISRIGHT = 40 Call GraphObjClose("2DAxis1") Call PicUpdate
Can you try this?
Basically you just want to have a new Curve and not reload the whole template (PicLoad("Template")) or change an Axis (the part with the axis ;)), so you wouldn't want to repeat that code.
4th of July is generally a slow response day on the forum..
I wonder why... 😉
07-05-2013 08:11 AM
That worked !
Thank you very much 🙂
07-05-2013 08:12 AM
No problems!
07-05-2013 08:16 AM
Oh actually we forgot my second question about the marker. Would you know what command allows to use different markers?
07-05-2013 08:37 AM
Actually, that's my mistake.
I focused on the second post 🙂
Here an adapted version:
Call PicLoad("Template") Call GraphObjNew("2D-Axis","2DAxis1") Call GraphObjOpen("2DAxis1") Call GraphObjNew("2D-Curve","New_Curve") 'Creates a new curve Call GraphObjOpen("New_Curve") 'Opens the curve object D2CChnYName = "GroupName/ChannelName" Call GraphObjClose("New_Curve") D2AXISTOP = 9 D2AXISBOTTOM = 40 D2AXISLEFT = 15 D2AXISRIGHT = 40 Call GraphObjClose("2DAxis1") Dim o2DLineExtensions, o2DAdditionalMarker Set o2DLineExtensions = Report.ActiveSheet.Objects.Item("2DAxis1").Curves2D.Item("New_Curve").Shape.Extensions Set o2DAdditionalMarker = o2DLineExtensions.Marker o2DAdditionalMarker.Type = eMarkerCross Call PicUpdate
Are you familiar with script recording?
If not, here's the information about it:
http://digital.ni.com/public.nsf/allkb/B769AE10EDB656D28625692D00583166?OpenDocument
It can help alot when starting to write scripts.
07-05-2013 08:52 AM
Thank you for your rapidity.
If I copy paste what you wrote, DIAdem tells me that : Variable is undefined : 'Report'
I tried to use the script recording as you advised me, and manually removed the line then put the cross markers, but nothing has been written between the moment I started it and the moment I stopped it. It sadly seems that what's going on in the report section is not always taken into account by the script recording 😞
07-05-2013 09:28 AM
Hello,
Did you read through the CTRL-A remarks?
Hmm, the Report should automatically refer to your Report class.
Which version of DIAdem are you using?
07-06-2013 07:42 PM
The REPORT object was first released in DIAdem 2012.
Brad Turpin
DIAdem Product Support Engineer
National Instruments