Additional Information
The script below was adapted from the help documentation
DIAdem Help, Constants for CurveChart2D adapted for the example above. The script
Dim oCurveObj, oMyDisplayObj, oMyConstX, oMyConstY
View.Sheets(1).Areas(1).DisplayObjType = "CurveChart2D"
Set oMyDisplayObj = View.Sheets(1).Areas(1).DisplayObj
Set oCurveObj = oMyDisplayObj.Curves2D.Add("[1]/[1]","[1]/[2]")
oCurveObj.Color = "green"
Set oMyConstX = oMyDisplayObj.Constants.Add("13.688",0)
oMyConstX.Color = "red"
Set oMyConstY = oMyDisplayObj.Constants.Add("40",1)
oMyConstY.Color = "red"The script below was adapted from the help documentation
DIAdem Help, XConstant for 2DConstant. The script creates a report layout, loads data, creates a 2D axis system, plots data from the Data Portal, and plots a constant at X = 10 and Y = 20.
Dim oMy2DAxisSystem, oMyCurveLine, oMyCurveConst, oMyPos, oMySettings, oMyLineShape, oMyConstShape
Call Report.NewLayout()
Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
Call Data.Root.Clear()
Call DataFileLoad(DataReadPath & "Report_Data.tdm","TDM","")
Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate
oMyPos.X1 = 20
oMyPos.X2 = 80
oMyPos.Y1 = 20
oMyPos.Y2 = 80
Set oMyCurveLine = oMy2DAxisSystem.Curves2D.Add(e2DShapeLine, "MyCurve")
Set oMyLineShape = oMyCurveLine.Shape
oMyLineShape.XChannel.Reference = "[1]/[1]"
oMyLineShape.YChannel.Reference = "[1]/[2]"
Set oMyCurveConst = oMy2DAxisSystem.Curves2D.Add(e2DShapeConstant, "MyConstant")
Set oMyConstShape = oMyCurveConst.Shape
oMyConstShape.XConstant.Reference = 10
oMyConstShape.YConstant.Reference = 20
Set oMySettings = oMyCurveConst.Shape.Settings
Call oMySettings.Line.Color.SetPredefinedColor(eColorIndexBlue)
oMySettings.Line.Width = eLineWidth0100
Call Report.Refresh()