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,

    i assume you looking for this command
    this only works if there is a reference with a diameter

    getting the nominal of the reference ID
    DmisCommand.GetTextEx(SIZE_NOMINAL, 0, "SIZE")



    getting the mesured of the reference ID
    DmisCommand.GetText(UPPER_SIZE, LoopIndex)

    DmisCommand.GetText(LOWER_SIZE, LoopIndex)


    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 & "Upper Toleranz: " & DmisCommand.GetText(FORM_TOLERANCE, 1) & Chr(13)
        OutputText = OutputText & "lower Toleranz: " & "0" & Chr(13)
        OutputText = OutputText & "SIZE_NOMINAL: " & DmisCommand.GetTextEx(SIZE_NOMINAL, 0, "SIZE") & Chr(13)
    
        LoopIndex = 1
        sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
        While sPuffer <> ""
          OutputText = OutputText & " ->" & sPuffer & " DIM_DEVIATION = " & DmisCommand.GetTextEx(DIM_DEVIATION, LoopIndex, "SEG=1") & Chr(13)
          OutputText = OutputText & " ->" & sPuffer & " UPPER_SIZE = " & DmisCommand.GetText(UPPER_SIZE, LoopIndex) & Chr(13)
          OutputText = OutputText & " ->" & sPuffer & " LOWER_SIZE = " & DmisCommand.GetText(LOWER_SIZE, LoopIndex) & Chr(13)
          OutputText = OutputText & " " & Chr(13)
    
          LoopIndex = LoopIndex + 1
          sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
        Wend
    
    
        MsgBox OutputText
      End If
    
      Next DmisCommand
    End Sub
    
Reply
  • good day,

    i assume you looking for this command
    this only works if there is a reference with a diameter

    getting the nominal of the reference ID
    DmisCommand.GetTextEx(SIZE_NOMINAL, 0, "SIZE")



    getting the mesured of the reference ID
    DmisCommand.GetText(UPPER_SIZE, LoopIndex)

    DmisCommand.GetText(LOWER_SIZE, LoopIndex)


    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 & "Upper Toleranz: " & DmisCommand.GetText(FORM_TOLERANCE, 1) & Chr(13)
        OutputText = OutputText & "lower Toleranz: " & "0" & Chr(13)
        OutputText = OutputText & "SIZE_NOMINAL: " & DmisCommand.GetTextEx(SIZE_NOMINAL, 0, "SIZE") & Chr(13)
    
        LoopIndex = 1
        sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
        While sPuffer <> ""
          OutputText = OutputText & " ->" & sPuffer & " DIM_DEVIATION = " & DmisCommand.GetTextEx(DIM_DEVIATION, LoopIndex, "SEG=1") & Chr(13)
          OutputText = OutputText & " ->" & sPuffer & " UPPER_SIZE = " & DmisCommand.GetText(UPPER_SIZE, LoopIndex) & Chr(13)
          OutputText = OutputText & " ->" & sPuffer & " LOWER_SIZE = " & DmisCommand.GetText(LOWER_SIZE, LoopIndex) & Chr(13)
          OutputText = OutputText & " " & Chr(13)
    
          LoopIndex = LoopIndex + 1
          sPuffer = DmisCommand.GetText(REF_ID, LoopIndex)
        Wend
    
    
        MsgBox OutputText
      End If
    
      Next DmisCommand
    End Sub
    
Children