Your Products have been synced, click here to refresh
' Replaces a coordinate value in DCC/measured features ' with a variable. The example below replaces the ' theoretical and target Z-coordinate with the contents ' of RChar (currently "W"). ' Custommade for user 233229920 @ PC-DMIS User Forum ' ' Ex. <10,20,30>, <0,0,1> ' (X,Y,Z), (I,J,K) will become ' <10,20,W>, <0,0,1> ' ' vpt.se 2011 Sub Main Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand 'Initialization Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim iCnt As Integer Dim RChar As String [COLOR="#0000FF"]RChar [/COLOR]= "[COLOR="#FF0000"]W[/COLOR]" For iCnt = 1 To PCDCommands.Count Set PCDCommand = PCDCommands.Item(iCnt) If (PCDCommand.IsDCCFeature) or (PCDCommand.IsMeasuredFeature) Then retval = PCDCommand.SetExpression ([COLOR="#0000FF"]RChar[/COLOR], [COLOR="#FF0000"]THEO_Z[/COLOR], 0) retval = PCDCommand.SetExpression ([COLOR="#0000FF"]RChar[/COLOR], [COLOR="#FF0000"]TARG_Z[/COLOR], 0) End If PCDPartProgram.Refresh Next iCnt 'Cleanup Set PCDCommands = Nothing Set PCDPartProgram = Nothing Set PCDPartPrograms = Nothing Set PCDApp = Nothing End Sub
' Replaces a coordinate value in DCC/measured features ' with a variable. The example below replaces the ' theoretical and target Z-coordinate with the contents ' of RChar (currently "W"). ' Custommade for user 233229920 @ PC-DMIS User Forum ' ' Ex. <10,20,30>, <0,0,1> ' (X,Y,Z), (I,J,K) will become ' <10,20,W>, <0,0,1> ' ' vpt.se 2011 Sub Main Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand 'Initialization Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim iCnt As Integer Dim RChar As String [COLOR="#0000FF"]RChar [/COLOR]= "[COLOR="#FF0000"]W[/COLOR]" For iCnt = 1 To PCDCommands.Count Set PCDCommand = PCDCommands.Item(iCnt) If (PCDCommand.IsDCCFeature) or (PCDCommand.IsMeasuredFeature) Then retval = PCDCommand.SetExpression ([COLOR="#0000FF"]RChar[/COLOR], [COLOR="#FF0000"]THEO_Z[/COLOR], 0) retval = PCDCommand.SetExpression ([COLOR="#0000FF"]RChar[/COLOR], [COLOR="#FF0000"]TARG_Z[/COLOR], 0) End If PCDPartProgram.Refresh Next iCnt 'Cleanup Set PCDCommands = Nothing Set PCDPartProgram = Nothing Set PCDPartPrograms = Nothing Set PCDApp = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |