![]() | DIAdem 2012 Help |
![]() | DIAdem 2014 Help |
![]() | DIAdem 2015 Help |
![]() | DIAdem 2017 Help |
![]() | DIAdem 2018 Help |
![]() | DIAdem 2019 Help |
The AxisSystem2DCustomScaling object provides a user-defined axis scaling in a 2D axis system in DIAdem REPORT.
![]() | 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 a 2D axis system with a curve and assigns the user-defined axis scaling with the ID MotorWarmScaling to the y-axis:
Dim oMy2DAxisSystem, oMyPos, oMyYScaling, oMy2DCurve, oMyCustomScalings, oMyCustomScalingObj Call Report.NewLayout() Call Data.Root.Clear() Call DataFileLoad(DataReadPath & "Example.tdm","TDM","") 'Creating Axis System and Curve Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem") Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate oMyPos.X1 = 20 oMyPos.X2 = 80 oMyPos.Y1 = 20 oMyPos.Y2 = 80 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.AxisSystem2DList 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 CustomScalingAxisSystem2DContext 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
BaseScalingType | EventName | ID | Index | Label
AxisSystem2DCustomScalings.Add | AxisSystem2DCustomScalings.Item
Helpful
Not Helpful