Your Products have been synced, click here to refresh
Dim oPcd As PCDLRN.Application = New PCDLRN.Application Dim oCmds As Object = oPcd.ActivePartProgram.Commands Dim oPnt As Command Dim mX As Double Dim mY As Double Dim mZ As Double Dim tX As Double Dim tY As Double Dim tZ As Double Dim sVals As String = "" oPcd.Visible = False For Each oCmd As Command In oCmds If oCmd.IsDimension AndAlso oCmd.Type = DIMENSION_PROFILE Then sVals &= oCmd.ID & vbCrLf Dim fs As Command = oCmds.item(oCmd.DimensionCommand.Feat1) 'get the referenced feature set For i As Integer = 1 To fs.FeatureCommand.NumHits 'iterate through each point in the feature set oPnt = oCmds.item(fs.GetText(REF_ID, i)) 'get the point command oPnt.FeatureCommand.GetPoint(FPOINT_TYPES.FPOINT_CENTROID, FDATA_DATASET.FDATA_MEAS, mX, mY, mZ) 'get measured values oPnt.FeatureCommand.GetPoint(FPOINT_TYPES.FPOINT_CENTROID, FDATA_DATASET.FDATA_TARG, tX, tY, tZ) 'get theo values Dim dDeviation As Double = Math.Sqrt((tX - mX) ^ 2 + (tY - mY) ^ 2 + (tZ - mZ) ^ 2) 'calculate deviation sVals &= " " & oPnt.ID & " " & dDeviation.ToString("###0.0000") & vbCrLf Next End If Next oPcd.Visible = True oCmds = Nothing oPcd = Nothing Console.WriteLine(sVals)
Dim oPcd As PCDLRN.Application = New PCDLRN.Application Dim oCmds As Object = oPcd.ActivePartProgram.Commands Dim oPnt As Command Dim mX As Double Dim mY As Double Dim mZ As Double Dim tX As Double Dim tY As Double Dim tZ As Double Dim sVals As String = "" oPcd.Visible = False For Each oCmd As Command In oCmds If oCmd.IsDimension AndAlso oCmd.Type = DIMENSION_PROFILE Then sVals &= oCmd.ID & vbCrLf Dim fs As Command = oCmds.item(oCmd.DimensionCommand.Feat1) 'get the referenced feature set For i As Integer = 1 To fs.FeatureCommand.NumHits 'iterate through each point in the feature set oPnt = oCmds.item(fs.GetText(REF_ID, i)) 'get the point command oPnt.FeatureCommand.GetPoint(FPOINT_TYPES.FPOINT_CENTROID, FDATA_DATASET.FDATA_MEAS, mX, mY, mZ) 'get measured values oPnt.FeatureCommand.GetPoint(FPOINT_TYPES.FPOINT_CENTROID, FDATA_DATASET.FDATA_TARG, tX, tY, tZ) 'get theo values Dim dDeviation As Double = Math.Sqrt((tX - mX) ^ 2 + (tY - mY) ^ 2 + (tZ - mZ) ^ 2) 'calculate deviation sVals &= " " & oPnt.ID & " " & dDeviation.ToString("###0.0000") & vbCrLf Next End If Next oPcd.Visible = True oCmds = Nothing oPcd = Nothing Console.WriteLine(sVals)
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |