DIAdem Help

Method: Add for Segments

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

Method: Add for Segments

Adds an object to the Segments collection in DIAdem VIEW and returns a Segment object:

Set oSegment = Object.Add(XChannel, YChannel, lpszDirection)
ObjectSegments
Object with this method
XChannelVariant
Specifies the name or the number of the x-channel to be displayed.
YChannelVariant
Specifies the name or the number of the y-channel to be displayed.
lpszDirectionString
Specifies whether DIAdem displays the segment in horizontal or in vertical direction.
oSegmentSegment
Returned object

The following example creates a 2D axis system with a curve and a segment:

VBScriptPython

 

Call View.Sheets.RemoveAll()
Dim oMySheet: Set oMySheet = View.Sheets.Add("NewSheet")
Dim oMyArea: Set oMyArea = oMySheet.ActiveArea
oMyArea.DisplayObjType = "CurveChart2D"
Call oMyArea.DisplayObj.Curves2D.Add("[1]/[1]","[1]/[3]")
Call oMyArea.DisplayObj.Segments.Add("[1]/[2]","[1]/[4]","X")