Object: TransformDataContextXYZ
- Updated2024-09-12
- 3 minute(s) read
DIAdem REPORT > Objects > Context Objects > Object: TransformDataContextXYZ
Object: TransformDataContextXYZ
The TransformDataContextXYZ object provides the input and output channels for the curve transformation as an object in a 3D axis system in DIAdem REPORT. Use the TransformDataContextXYZ object for all 3D display types in which the data is available in triplet structure, for example, Surface, 3D curve, Spikes, or Points. The user command receives the TransformDataContextXYZ 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, oMyPos, oMy3DCurve, oMy3DCurveTrans, oMyShape Call Data.Root.Clear() Call DataFileLoad(DataReadPath & "Report_Data.tdm","TDM","") Call Report.NewLayout() 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(e3DShapeSurface, "MyNew3DCurve") Set oMyShape = oMy3DCurve.Shape oMyShape.DataStructure = e3DDataStructureTriplet oMyShape.XChannel.Reference = "[2]/[1]" oMyShape.YChannel.Reference = "[2]/[2]" oMyShape.ZChannel.Reference = "[2]/[3]" Set oMy3DCurveTrans = oMy3DAxisSystem.Curves3D.Add(e3DShapeSurface, "MyNew3DCurveTrans") Set oMyShape = oMy3DCurveTrans.Shape oMyShape.DataStructure = e3DDataStructureTriplet oMyShape.XChannel.Reference = "[2]/[1]" oMyShape.YChannel.Reference = "[2]/[2]" oMyShape.ZChannel.Reference = "[2]/[3]" 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
XChannelNumberIn | XChannelNumberOut | YChannelNumberIn | YChannelNumberOut | ZChannelNumberIn | ZChannelNumberOut
Returned From
D2CurveTransformingContext.DataContext | D3CurveTransformingContext.DataContext
