DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

2D scaling using a VBscript

Hi,


I would like to change the begin and end point of a 2D system using a VBscript inside Diadem . But I have not found an example of how I can use "D2AxisXScaletype" parameter.
I have tried in this way:

Call GraphObjChnClear("2DAxis1")
call GraphObjOpen(D2AxisYObj(D2AxisPairNo(1)))
D2AxisXScaletype= "begin/end manual"
D2AxisXDivMode="linear"

' this is my start point
D2AxisXBegin=chd(1, intNumChannel)
' thjs is my last point
D2AxisXEnd=chd(NumMaxMin, intNumChannel)
call GraphObjClose(D2AxisYObj(D2AxisPairNo(1)))

' Close axis object.
Call GraphObjClose("2DAxis1")

But I generate the following error:

Invalid variable access (D2AXISXSCALETYPE).
Parent object open?


Can someone send my an example of how I should work with "D2AxisXScaletype"?

Thanks
0 Kudos
Message 1 of 3
(3,599 Views)
Hi koniker,

You're close to having the code correct. But you open up the Y axis and then try to edit the X axis scaling method-- that won't work. Try this code instead:

intNumChannel = 1
NumMaxMin = ChnLength(intNumChannel)
Call GraphObjOpen("2DAxis1")
Call GraphObjOpen(D2AxisXObj(1))
D2AxisXScaletype = "begin/end manual"
D2AxisXDivMode = "linear"
D2AxisXBegin = ChDX(1, intNumChannel)
D2AxisXEnd = ChDX(NumMaxMin, intNumChannel)
Call GraphObjClose(D2AxisXObj(1))
Call GraphObjClose("2DAxis1")
Call PicUpdate

Cheers,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,588 Views)
Thanks very much for your reply. I will try it.
0 Kudos
Message 3 of 3
(3,577 Views)