DIAdem Help

Object: 2DPalette

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

Object: 2DPalette

The 2DPalette object provides the properties of the palette in 2D axis systems or in polar axis systems in DIAdem REPORT.

The following example generates a 2D axis system with a curve, assigns the color Palette to the curve, and defines the properties of the palette:

VBScriptPython

 

Dim oMyReportObj, oMyPos, oMyCurve, oMyShape, oMyLine, oMyPalette, oMyPaletteLine
Dim iChannelMax, iChannelMin ,i
Call Report.NewLayout()
Set oMyReportObj = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
Set oMyPos = oMyReportObj.Position.ByCoordinate
oMyPos.X1 = 20
oMyPos.X2 = 80
oMyPos.Y1 = 20
oMyPos.Y2 = 80
Set oMyCurve = oMyReportObj.Curves2D.Add(e2DShapeLine, "MyCurve")
Set oMyShape = oMyCurve.Shape
oMyShape.XChannel.Reference = "[1]/[1]" 
oMyShape.YChannel.Reference = "[1]/[2]" 
iChannelMax = Data.Root.ChannelGroups(1).Channels(2).Properties("maximum").Value
iChannelMin = Data.Root.ChannelGroups(1).Channels(2).Properties("minimum").Value
Set oMyLine = oMyShape.Settings.Line
oMyLine.Color.ColorIndex = eColorIndexPalette
Set oMyPalette = oMyShape.Settings.Palette.Lines
i = 0
For Each oMyPaletteLine in oMyPalette
  i = i + 1
  oMyPaletteLine.LineType = eLineTypeDashDot
  oMyPaletteLine.Interval = 10
  oMyPaletteLine.Width = eLineWidth0035
  oMyPaletteLine.UpperLimit = iChannelMin + (iChannelMax - iChannelMin) / oMyPalette.Count * i
Next
Call Report.Refresh()