DIAdem Help

Method: Add for Constants

  • Updated2024-09-12
  • 2 minute(s) read

Method: Add for Constants

Adds an object to the Constants collection and returns a Constant object in the script interface of DIAdem VIEW.

Set oConstant = Object.Add(ValueExpression, Direction)
ObjectConstants
Object with this method
ValueExpressionString
Specifies the value of the constants.
DirectionLongInteger
Specifies whether DIAdem displays the constants parallel to the x-axis or to the y-axis:
 0
X-axis
 1
Y-axis
oConstantConstant
Returned object

The following example creates a 2D axis system with one curve and one constant in the active area:

VBScriptPython

 

Dim oMyChart, oMyConstX
View.ActiveSheet.ActiveArea.DisplayObjType = "CurveChart2D"
Set oMyChart = View.ActiveSheet.ActiveArea.DisplayObj 
Call oMyChart.Curves2D.Add("[1]/[1]","[1]/[2]") 
Set oMyConstX = oMyChart.Constants.Add("30",0) 
oMyConstX.Color = "red"