hexagon logo

Is there a way to access a PC-DMIS array variable from PC-DMIS Basic?

Is there a way to access a PC-DMIS array variable from PC-DMIS Basic? The Help for GetVariableValue() doesn't mention arrays and indices.
Parents
  • Yes, found them in the Type Library, but still not sure how to get at them. Experimenting...

    OK, this seems to work! But GetArrayUpperBound returns the number of elements + 1, and it took a while to find the .PointValue which is necessary to get at the parts (XYZ) of the indexed value.

    Thanks!

    
    Sub Main
      Dim App As Object 
      Set App = CreateObject ("PCDLRN.Application")
      Dim Part As Object
      Set Part = App.ActivePartProgram
      Dim Var As Object
      Dim i_var As Object
    
      Set Var = Part.GetVariableValue ("PT")
      MsgBox Var.GetArrayUpperBound
      Set i_var = var.getarrayindexvalue(2).PointValue
      MsgBox i_var.x
    
    End Sub
    
    
Reply
  • Yes, found them in the Type Library, but still not sure how to get at them. Experimenting...

    OK, this seems to work! But GetArrayUpperBound returns the number of elements + 1, and it took a while to find the .PointValue which is necessary to get at the parts (XYZ) of the indexed value.

    Thanks!

    
    Sub Main
      Dim App As Object 
      Set App = CreateObject ("PCDLRN.Application")
      Dim Part As Object
      Set Part = App.ActivePartProgram
      Dim Var As Object
      Dim i_var As Object
    
      Set Var = Part.GetVariableValue ("PT")
      MsgBox Var.GetArrayUpperBound
      Set i_var = var.getarrayindexvalue(2).PointValue
      MsgBox i_var.x
    
    End Sub
    
    
Children
No Data