Object: AxisSystem2DScaledCustomScaling

DIAdem 2018 Help


Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)


DIAdem 2015 Help
DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help

The AxisSystem2DScaledCustomScaling object provides a user-defined axis scaling in a 2D axis system in DIAdem REPORT in a scaled display.

Note   To test the following example scripts, first save the bottom script and select Settings»Extensions»User Commands to register it as a user command.

The following example creates the scaled display of a 2D axis system with a curve and assigns the user-defined axis scaling with the ID MotorWarmScaling to the y-axis:

Dim oDisplayDimensions, oMy2DAxisSystem, oMyPos, oMyYScaling, oMy2DCurve, oMyCustomScalings, oMyCustomScalingObj
Call Report.NewLayout()
Call Data.Root.Clear()
Call DataFileLoad(DataReadPath & "Example.tdm","TDM","")
'Activating Scaled Mode
Set oDisplayDimensions = Report.Settings.Page.Dimensions
oDisplayDimensions.ScaledHeight = 20
oDisplayDimensions.ScaledWidth = 30
oDisplayDimensions.UseScaledOutput = True
'Creating Axis System and Curve
Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem")
Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate
oMyPos.X1 = 5
oMyPos.X2 = 25
oMyPos.Y1 = 5
oMyPos.Y2 = 15
Set oMy2DCurve = oMy2DaxisSystem.Curves2D.Add(e2DShapeLine, "My2DDCurve")
oMy2DCurve.Shape.XChannel.Reference = "[1]/[1]"
oMy2DCurve.Shape.YChannel.Reference = "[1]/[2]"
'Creating Custom Scaling
Set oMyCustomScalings = Report.Settings.CustomScaling.AxisSystem2DScaledList
Call oMyCustomScalings.RemoveAll
Set oMyCustomScalingObj = oMyCustomScalings.Add("MotorWarmScaling")
oMyCustomScalingObj.BaseScalingType = eAxisAutoScalingCompleteAutomatic
oMyCustomScalingObj.EventName = "MyCustomScalingEvent2D"
oMyCustomScalingObj.Label = "LabelForMotorWarmScaling"
'Assigning Custom Scaling to Axis
Set oMyYScaling = oMy2DAxisSystem.YAxis.Scaling
oMyYScaling.AutoScalingType = eAxisAutoScalingCustom
oMyYScaling.CustomScalingID = "MotorWarmScaling"
Call Report.Refresh()

The user command calculates the values for the axis scaling. The user command receives a parameter. This parameter is a CustomScalingAxisSystem2DScaledContext object and provides information about the axis system and about the ID of the user-defined axis scaling:

Sub MyCustomScalingEvent2D(Context)
  Dim oMyAxisSystem, oMyAxis, MinMax
  Set oMyAxisSystem = Context.AxisSystem
  If Context.AxisType = e2DAxisTypeY Then
    Set oMyAxis = oMyAxisSystem.YAxisList(Context.AxisNumber)
    MinMax = ValMax(Abs(oMyAxis.Scaling.End),Abs(oMyAxis.Scaling.Begin))
    oMyAxis.Scaling.Origin = oMyAxis.Scaling.Begin
    oMyAxis.Scaling.Begin = -MinMax
    oMyAxis.Scaling.End = +MinMax
  End If
End Sub

Properties

BaseScalingType | EventName | ID | Index | Label

WAS THIS ARTICLE HELPFUL?

Not Helpful