Object: TransformDataContextXYX1Y1
- Updated2024-09-12
- 3 minute(s) read
DIAdem REPORT > Objects > Context Objects > Object: TransformDataContextXYX1Y1
Object: TransformDataContextXYX1Y1
The TransformDataContextConstantXYZ object provides the input and output channels for the curve transformation of a curve with the 4D Vector display as an object type in a 3D axis system in DIAdem REPORT. The user command receives the TransformDataContextXYX1Y1 object as a parameter. Use the curve transformation user command only to manipulate the values of temporary copies of the input channels. REPORT objects such as the worksheet, the axis system, and the curves can only be accessed in read-only mode.
![]() | Note To test the example script, you must first save the second script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands. |
The following example generates a 3D axis system with two curves and assigns the user command MyOn3DCurveTransformation to the second curve:
Dim oMy3DAxisSystem, oMy3DCurve, oMyPos, oMyShape, oMySettings, oMyArrowHead, oMyCurveLineExtension, oMy3DCurveTrans, _ oMyShapeTrans, oMyArrowHeadTrans, oMySettingsTrans, oMyCurveLineExtensionTrans Call Report.NewLayout() Call Data.Root.Clear() Call DataFileLoad(DataReadPath & "Report_Data.tdm","TDM","") Set oMy3DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject3DAxisSystem,"My3DAxisSystem") Set oMyPos = oMy3DAxisSystem.Position.ByCoordinate oMyPos.X1 = 20 oMyPos.X2 = 80 oMyPos.Y1 = 20 oMyPos.Y2 = 80 Set oMy3DCurve = oMy3DAxisSystem.Curves3D.Add(e3DShapeVector, "My3DCurve") Set oMyShape = oMy3DCurve.Shape oMyShape.VectorType = e3DVectorType4D oMyShape.XChannel.Reference = "[3]/[1]" oMyShape.YChannel.Reference = "[3]/[2]" oMyShape.XChannelEnd.Reference = "[3]/[3]" oMyShape.YChannelEnd.Reference = "[3]/[4]" Set oMySettings = oMyShape.Settings oMySettings.EndCoordinateType = e3DVectorEndCoordinateCartesianRelative oMySettings.ScalingType = e3DVectorScalingIsometric Set oMyArrowHead = oMySettings.ArrowHead oMyArrowHead.Type = e3DVectorHeadVectorEnd Set oMyCurveLineExtension = oMyShape.Extensions.CurveLine oMyCurveLineExtension.Visible = True Set oMy3DCurveTrans = oMy3DAxisSystem.Curves3D.Add(e3DShapeVector, "My3DCurveTrans") Set oMyShapeTrans = oMy3DCurveTrans.Shape oMyShapeTrans.VectorType = e3DVectorType4D oMyShapeTrans.XChannel.Reference = "[3]/[1]" oMyShapeTrans.YChannel.Reference = "[3]/[2]" oMyShapeTrans.XChannelEnd.Reference = "[3]/[3]" oMyShapeTrans.YChannelEnd.Reference = "[3]/[4]" Set oMySettingsTrans = oMyShapeTrans.Settings oMySettingsTrans.EndCoordinateType = e3DVectorEndCoordinateCartesianRelative oMySettingsTrans.ScalingType = e3DVectorScalingIsometric Set oMyArrowHeadTrans = oMySettingsTrans.ArrowHead oMyArrowHeadTrans.Type = e3DVectorHeadVectorEnd Set oMyCurveLineExtensionTrans = oMyShapeTrans.Extensions.CurveLine oMyCurveLineExtensionTrans.Visible = True oMy3DAxisSystem.Settings.UseCurveTransformation = TRUE oMy3DCurveTrans.OnCurveTransformation = "MyOn3DCurveTransformation" Call Report.Refresh()
The user command execute mathematical operations on the input channels depending on the curve type:
Sub MyOn3DCurveTransformation(TransformContext) Dim oMyDataContext Set oMyDataContext = TransformContext.DataContext Select Case TransformContext.DataType Case e3DCurveTransformDataTypeXYZ Call ChnCopy (oMyDataContext.XChannelNumberIn, oMyDataContext.XChannelNumberOut) 'Copy the input channel into the output channel Call ChnCopy (oMyDataContext.YChannelNumberIn, oMyDataContext.YChannelNumberOut) 'Copy the input channel into the output channel Call ChnSmooth(oMyDataContext.ZChannelNumberIn, oMyDataContext.ZChannelNumberOut, 100, "symmetric") 'Smooth the input channel and save the result as output channel Case e3DCurveTransformDataTypeXYX1Y1 Call ChnCopy (oMyDataContext.XChannelNumberIn ,oMyDataContext.XChannelNumberOut) 'Copy the input channel into the output channel Call ChnCopy (oMyDataContext.YChannelNumberIn ,oMyDataContext.YChannelNumberOut) 'Copy the input channel into the output channel Call ChnLinScale (oMyDataContext.X1ChannelNumberIn, oMyDataContext.X1ChannelNumberOut, 2, 0) 'Multiply the input channel with a value and save the result as output channel Call ChnLinScale (oMyDataContext.Y1ChannelNumberIn, oMyDataContext.Y1ChannelNumberOut, 2, 0) 'Multiply the input channel with a value and save the result as output channel Case e3DCurveTransformDataTypeXYZX1Y1Z1 Call ChnCopy (oMyDataContext.XChannelNumberIn, oMyDataContext.XChannelNumberOut) 'Copy the input channel into the output channel Call ChnCopy (oMyDataContext.YChannelNumberIn, oMyDataContext.YChannelNumberOut) 'Copy the input channel into the output channel Call ChnCopy (oMyDataContext.ZChannelNumberIn, oMyDataContext.ZChannelNumberOut) 'Copy the input channel into the output channel Call ChnLinScale (oMyDataContext.X1ChannelNumberIn, oMyDataContext.X1ChannelNumberOut, 2, 0) 'Multiply the input channel with a value and save the result as output channel Call ChnLinScale (oMyDataContext.Y1ChannelNumberIn, oMyDataContext.Y1ChannelNumberOut, 2, 0) 'Multiply the input channel with a value and save the result as output channel Call ChnLinScale (oMyDataContext.Z1ChannelNumberIn, oMyDataContext.Z1ChannelNumberOut, 2, 0) 'Multiply the input channel with a value and save the result as output channel Case e3DCurveTransformDataTypeCXCYCZ oMyDataContext.ConstXOut = oMyDataContext.ConstXIn + 20 'Add value to input constant oMyDataContext.ConstYOut = oMyDataContext.ConstYIn + 20 'Add value to input constant oMyDataContext.ConstZOut = oMyDataContext.ConstZIn + 20 'Add value to input constant End Select End Sub
Properties
X1ChannelNumberIn | X1ChannelNumberOut | XChannelNumberIn | XChannelNumberOut | Y1ChannelNumberIn | Y1ChannelNumberOut | YChannelNumberIn | YChannelNumberOut
Returned From
D2CurveTransformingContext.DataContext | D3CurveTransformingContext.DataContext
