hexagon logo

Help with OLE Automation

Now that I have information in a way that imports and exports the information correctly, I have been tasked with creating an OLE to automatically import the data into the SPC software. I have one that sort of works (as in opens the program, logs in, opens the right collection plan, etc) and I can get put in static information, but I am unsure how to call the information out of PC DMIS to have it be placed in the spots we need in the SPC software being used.

Has anyone else done this? Can anyone explain to me how find the variable and the measurement output in PC DMIS? I am using version 4.2 if that helps any.

Thanks so much.
Parents
  • So here is something that I tried, but so far it is not working.

    Dim App As Object
    Dim Part As Object
    Dim Cmds As Object
    Dim Cmd As Object
    Dim MyID As String
    Dim MyNom As String
    Dim MyDev As String
    Dim MyAx As String
    Dim Meas As String
    Dim NewID As String
    Dim n As Integer
    Dim c As String
    Sub Main()
    Set App = CreateObject("PCDLRN.Application")
    Set Part = App.ActivePartProgram
    Set Cmds = Part.Commands

    For Each Cmd In Cmds
    If Cmd.IsDimension Then
    MyID = Cmd.DimensionCommand.ID
    If MyID = " " Then
    n = Command.Count - 1
    MyID = Cmd.DimensionCommand.ID(n)
    End If
    MyNom = "ID ="
    MsgBox MyNom & MyID
    End If
    Next
    End Sub

    The thought behind this was that if I was scanning forward in the program it would be command.count +1 so backward would be command.count - 1 and that should give me the previous id, maybe.
Reply
  • So here is something that I tried, but so far it is not working.

    Dim App As Object
    Dim Part As Object
    Dim Cmds As Object
    Dim Cmd As Object
    Dim MyID As String
    Dim MyNom As String
    Dim MyDev As String
    Dim MyAx As String
    Dim Meas As String
    Dim NewID As String
    Dim n As Integer
    Dim c As String
    Sub Main()
    Set App = CreateObject("PCDLRN.Application")
    Set Part = App.ActivePartProgram
    Set Cmds = Part.Commands

    For Each Cmd In Cmds
    If Cmd.IsDimension Then
    MyID = Cmd.DimensionCommand.ID
    If MyID = " " Then
    n = Command.Count - 1
    MyID = Cmd.DimensionCommand.ID(n)
    End If
    MyNom = "ID ="
    MsgBox MyNom & MyID
    End If
    Next
    End Sub

    The thought behind this was that if I was scanning forward in the program it would be command.count +1 so backward would be command.count - 1 and that should give me the previous id, maybe.
Children
No Data