09-15-2016 02:43 AM
Hi
How do I add one or two cordinate marks on a graph from script if there is an limit error.
If there isn´t any limit error then I don´t want to add cordinate markers on graph.
Regards
René
09-16-2016 04:20 AM - edited 09-16-2016 04:24 AM
Hi there,
Do you mean using something like this?
https://decibel.ni.com/content/docs/DOC-3994
-Michael
09-16-2016 04:46 AM
Hi
Yes and then with one or more markers/coordinates on.
There isn´t any markers/coordinates on
If could be difference from graph to graph in our system.
Regards
René
09-16-2016 06:26 AM
The following below do the trick 🙂
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim oMy2DAxisSystem, oMyCurveLine, oMyCurveConst, oMyPos, oMySettings,oMyCoordShape
Report.NewLayout
Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate
'oMyPos.X1 = 20
'oMyPos.X2 = 80
'oMyPos.Y1 = 20
'oMyPos.Y2 = 80
Set oMyCurveLine = oMy2DAxisSystem.Curves2D.Add(e2DShapeLine, "MyCurve")
oMyCurveLine.Shape.XChannel.Reference = "[1]/[1]"
oMyCurveLine.Shape.YChannel.Reference = "[1]/[2]"
'Set oMyCurveConst = oMy2DAxisSystem.Curves2D.Add(e2DShapeConstant, "MyConstant")
Set oMyCurveConst = oMy2DAxisSystem.Curves2D.Add(e2DShapeCoordinate, "My2DCurveCoord")
oMyCurveConst.Shape.Settings.Type= eMarkerSquare
oMyCurveConst.Shape.XCoordinate.Reference=10
oMyCurveConst.Shape.YCoordinate.Reference=20
'oMyCurveConst.Shape.XConstant.Reference = 10
'oMyCurveConst.Shape.YConstant.Reference = 20
'Set oMyCurveConst = oMy2DAxisSystem.Curves2D.Add(e2DShapeConstant, "MyConstant2")
Set oMyCurveConst = oMy2DAxisSystem.Curves2D.Add(e2DShapeCoordinate, "My2DCurveCoord2")
oMyCurveConst.Shape.Settings.Type= eMarkerSquare
oMyCurveConst.Shape.XCoordinate.Reference=30
oMyCurveConst.Shape.YCoordinate.Reference=40
'oMyCurveConst.Shape.XConstant.Reference = 30
'oMyCurveConst.Shape.YConstant.Reference = 40
'set oMySettings = oMyCurveConst.Shape.Settings
'Call oMySettings.Line.Color.SetPredefinedColor(eColorIndexBlue)
'oMySettings.Line.Width = eLineWidth0100