DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic View with DIAdem 2011

Hi Near,

 

You should set the DisplayType property to be "CurveChart2D" before you can access the Graph elements.  Then if the Graph is truly empty, you must first create a new curve.

 

Set Sheet = View.Sheets("Sheet 1")
Set NewViewArea = Sheet.Areas(2)
NewViewArea.DisplayObjType = "CurveChart2D"
Set NewViewGraph = NewViewArea.DisplayObj
Call NewViewGraph.Curves.Add(XChannel, YChannel)

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 11 of 14
(2,598 Views)

Thank you Brad !

 

When I try to display a channel from scratch using a script, I bump into the following error: "An invalid index was accessed."

Here is my code:

 

View.ActiveSheet.Cursor.Type = "Curve"
Set DisplaySheet = View.Sheets("Sheet 1")

Set DisplayArea = DisplaySheet.Areas.Item(1)
DisplayArea.DisplayObjType = "CurveChart2D" 
Call View.Sheets("Sheet 1").Areas.Item(1).DisplayObj.Curves.RemoveAll
View.Sheets("Sheet 1").Areas(1).DisplayObj.Curves.Item(1).YChannelName = "ChannelName"

 Even when I replace the last line by this one:

 

DisplayArea.DisplayObj.Curves.Add("", 1)    

 I get the following error: "Cannot use parentheses when calling a Sub". The problem is that I am not using any sub in the VBS file containing this code... I am feeling that the error is minor and only few characters should be corrected.

0 Kudos
Message 12 of 14
(2,578 Views)

Actually do not bother anymore, I was forgetting a Call somewhere and it obviously took me hours to realize it........

 

I would be interested in the commands used to change markers and colors in VIEW, I'm sure a couple methods will do but I could not find the right one (especially for colors) while exploring this forum as well as the help. Edit: done

0 Kudos
Message 13 of 14
(2,568 Views)

Hi Near,

 

I suggest you interactively configure the VIEW graph to show the markers just like you want them to look, then pop up the configuration dialog and hit <Ctrl-A> for DIAdem 2011 and older or <Ctrl-C> for DIAdem 2012 or newer.  This will put the whole contents of that dialog onto the Windows Clipboard.  If you then go to a script in the SCRIPT panel and hit <Ctrl-V>, you will get the following code:

 

Dim oCurveObj
Set oCurveObj = View.Sheets(1).Areas(1).DisplayObj.Curves.item(1)
oCurveObj.LabelChannelName        =""
oCurveObj.LabelIndexChannelName   =""
oCurveObj.LabelChannelOrientation ="horizontal"
oCurveObj.MarkerType              ="circle"
oCurveObj.MarkerLineWidth         ="min"
oCurveObj.MarkerSize              =2
oCurveObj.MarkerColorAuto         =true
oCurveObj.MarkerColor             ="black"
oCurveObj.MarkerColorRGB          =0
oCurveObj.MarkerFillColorAuto     =true
oCurveObj.MarkerFillColor         =""
oCurveObj.MarkerFillColorRGB      =0
oCurveObj.MarkerFrequencyMode     ="CalcNPoint"
oCurveObj.MarkerIntervalPoints    =1
oCurveObj.MarkerIntervalLength    =10
oCurveObj.MarkerAtBegin           =false
oCurveObj.MarkerAtEnd             =false

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 14 of 14
(2,552 Views)