Object: D2CurveDrawingContext
- Updated2024-09-12
- 2 minute(s) read
DIAdem REPORT > Objects > Context Objects > Object: D2CurveDrawingContext
Object: D2CurveDrawingContext
The D2CurveDrawingContext object provides information about the 2D axis system and the worksheet into which DIAdem REPORT is plotting the current curve.
![]() | Note To test the example script, you must first save the script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands. |
The following example executes the user command MyOn2DCurveDrawEvent when a curve is plotted in a 2D axis system. The user command changes the display of the curve which DIAdem is plotting and displays the associated worksheet, the axis system, and the curve. The user command receives two parameters. The first parameter corresponds to a D2CurveDrawingContext object and provides information about the 2D axis system and the worksheet into which DIAdem is plotting the curve. The second parameter corresponds to a 2DCurve object and provides information about the curve DIAdem is plotting. The user command is only executed if you use the Enable for CurveExpansionSettings property to enable the expansion mode:
Report.Events.Drawing.OnAxisSystem2DCurve = "MyOn2DCurveDrawEvent" Sub MyOn2DCurveDrawEvent(Context, CurrCurve) Dim oMyAxis, oMyCurve Set oMyAxis = Context.AxisSystem Set oMyCurve = CurrCurve Report.Settings.CurveExpansion.Enable = True Select Case oMyCurve.ShapeType Case e2DShapeLine oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeLineAndPoints oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeSpikes oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeBars oMyCurve.Shape.Settings.BorderLine.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeOutlineBars oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeDifferential oMyCurve.Shape.Settings.BorderLine.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeConstant oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeSpikesHorizontal oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeBarsHorizontal oMyCurve.Shape.Settings.BorderLine.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeOutlineBarsHorizontal oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeSpecialCombination oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeCoordinate oMyCurve.Shape.Settings.MarkerBorderLine.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) Case e2DShapeFilledArea oMyCurve.Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise) End select Call MsgBox("Sheet: " & Context.Sheet.Name & VBCrLf & "Axis system: " & oMyAxis.Name & "Curve name: " & oMyCurve.Name) End Sub
