hexagon logo

Problem with Command.GetFieldValue and the new GeoTol (2020 R2)

Greetings,


I have been using the VB.Script ".GetFieldValue" since version 2014.1 to transfer measured values ​​to an external application.
This function ".GetFieldValue" ​​was nice to transfer data without an additional assign command

Unfortunately this no longer works with the new GeoTol in 2020R2.
There are simply no measured values ​​stored in GeoTol.Commands or I cannot find them.

Can someone tell me how else to access this data, if possible with a single function?










Parents
  • Good Day,

    Finally, i figured out how it supposed to be done:

    With this you can call up the measured values ​​from the geoTol commands (2020R2) in a script and use them for something.
    (for example database storage)


    Sub test()
    
      Dim App, Part, Cmds, DmisCommand As Object
      Dim OutputText, sPuffer As String
      Dim RetVal
      Dim LoopIndex As Integer
    
      Set App = CreateObject("PCDLRN.Application")
      Set Part = App.PartPrograms.Item(1)
      Set Cmds = Part.Commands
    
      For Each DmisCommand In Cmds
    
        If (DmisCommand.Type = ISO_TOLERANCE_COMMAND) Or (DmisCommand.Type = ASME_TOLERANCE_COMMAND) Then
          OutputText = "STANDARD: " & DmisCommand.GetText(STANDARD, 0) & Chr(13)
          OutputText = OutputText & "UNIT_TYPE: " & DmisCommand.GetText(UNIT_TYPE, 0) & Chr(13)
          OutputText = OutputText & "SEGMENT_TYPE_TOGGLE: " & DmisCommand.GetText(SEGMENT_TYPE_TOGGLE, 1) & Chr(13)
          OutputText = OutputText & "OUTPUT_TYPE: " & DmisCommand.GetText(OUTPUT_TYPE, 0) & Chr(13)
          OutputText = OutputText & "ARROW_DENSITY: " & DmisCommand.GetText(ARROW_DENSITY, 0) & Chr(13)
          OutputText = OutputText & "Upper Toleranz: " & DmisCommand.GetText(FORM_TOLERANCE, 1) & Chr(13)
          OutputText = OutputText & "lower Toleranz: " & "0" & Chr(13)
    
    
          LoopIndex = 1
          sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
          While sPuffer <> ""
            OutputText = OutputText & " ->" & sPuffer & " = " & DmisCommand.GetTextEx(DIM_DEVIATION, LoopIndex, "SEG=1") & Chr(13)
    
            LoopIndex = LoopIndex + 1
            sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
          Wend
    
          MsgBox OutputText
        End If
    
      Next DmisCommand
    End Sub
    
Reply
  • Good Day,

    Finally, i figured out how it supposed to be done:

    With this you can call up the measured values ​​from the geoTol commands (2020R2) in a script and use them for something.
    (for example database storage)


    Sub test()
    
      Dim App, Part, Cmds, DmisCommand As Object
      Dim OutputText, sPuffer As String
      Dim RetVal
      Dim LoopIndex As Integer
    
      Set App = CreateObject("PCDLRN.Application")
      Set Part = App.PartPrograms.Item(1)
      Set Cmds = Part.Commands
    
      For Each DmisCommand In Cmds
    
        If (DmisCommand.Type = ISO_TOLERANCE_COMMAND) Or (DmisCommand.Type = ASME_TOLERANCE_COMMAND) Then
          OutputText = "STANDARD: " & DmisCommand.GetText(STANDARD, 0) & Chr(13)
          OutputText = OutputText & "UNIT_TYPE: " & DmisCommand.GetText(UNIT_TYPE, 0) & Chr(13)
          OutputText = OutputText & "SEGMENT_TYPE_TOGGLE: " & DmisCommand.GetText(SEGMENT_TYPE_TOGGLE, 1) & Chr(13)
          OutputText = OutputText & "OUTPUT_TYPE: " & DmisCommand.GetText(OUTPUT_TYPE, 0) & Chr(13)
          OutputText = OutputText & "ARROW_DENSITY: " & DmisCommand.GetText(ARROW_DENSITY, 0) & Chr(13)
          OutputText = OutputText & "Upper Toleranz: " & DmisCommand.GetText(FORM_TOLERANCE, 1) & Chr(13)
          OutputText = OutputText & "lower Toleranz: " & "0" & Chr(13)
    
    
          LoopIndex = 1
          sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
          While sPuffer <> ""
            OutputText = OutputText & " ->" & sPuffer & " = " & DmisCommand.GetTextEx(DIM_DEVIATION, LoopIndex, "SEG=1") & Chr(13)
    
            LoopIndex = LoopIndex + 1
            sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
          Wend
    
          MsgBox OutputText
        End If
    
      Next DmisCommand
    End Sub
    
Children