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 an example of what the program is saying:

    Set DmisCommand = DmisCommands.Add(DIMENSION_START_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = CIRC2 DIA
    retval = DmisCommand.PutText ("CIRC2 DIA", ID, 0)
    ' Set Reference Id = CIR2- OUTER CIRCLE ABOVE STEP
    retval = DmisCommand.PutText ("CIR2- OUTER CIRCLE ABOVE STEP", REF_ID, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Standard Deviation = 0.000300
    retval = DmisCommand.PutText ("0.000300", STANDARD_DEVIATION, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_D_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Nominal = 3.6460
    retval = DmisCommand.PutText (" 3.6460", NOMINAL, 0)
    ' Set Measured = 3.6433
    retval = DmisCommand.PutText (" 3.6433", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0020
    retval = DmisCommand.PutText (" 0.0020", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0020
    retval = DmisCommand.PutText (" 0.0020", F_MINUS_TOL, 0)
    ' Set Max = 3.6444
    retval = DmisCommand.PutText (" 3.6444", DIM_MAX, 0)
    ' Set Min = 3.6427
    retval = DmisCommand.PutText (" 3.6427", DIM_MIN, 0)
    ' Set Deviation = -0.0027
    retval = DmisCommand.PutText (" -0.0027", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0007
    retval = DmisCommand.PutText (" 0.0007", DIM_OUTTOL, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_END_LOCATION, TRUE)
    DmisCommand.Marked = TRUE

    I have tried the ID and the REF_ID and I still get a zero reading, although this tells me that it is getting a measurement. But there is no set Axis in this section, but in the roundess there is:

    Set DmisCommand = DmisCommands.Add(DIMENSION_CIRCULARITY, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = CIR2 ROUNDNESS
    retval = DmisCommand.PutText ("CIR2 ROUNDNESS", ID, 0)
    ' Set Reference Id = CIR2- OUTER CIRCLE ABOVE STEP
    retval = DmisCommand.PutText ("CIR2- OUTER CIRCLE ABOVE STEP", REF_ID, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Axis = M
    retval = DmisCommand.PutText ("M", AXIS, 0)
    ' Set Nominal = 0.0000
    retval = DmisCommand.PutText (" 0.0000", NOMINAL, 0)
    ' Set Measured = 0.0009
    retval = DmisCommand.PutText (" 0.0009", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0050
    retval = DmisCommand.PutText (" 0.0050", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0000
    retval = DmisCommand.PutText (" 0.0000", F_MINUS_TOL, 0)
    ' Set Max = 0.0005
    retval = DmisCommand.PutText (" 0.0005", DIM_MAX, 0)
    ' Set Min = -0.0003
    retval = DmisCommand.PutText (" -0.0003", DIM_MIN, 0)
    ' Set Deviation = 0.0009
    retval = DmisCommand.PutText (" 0.0009", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0000
    retval = DmisCommand.PutText (" 0.0000", DIM_OUTTOL, 0)
    ' Set Standard Deviation = 0.000162
    retval = DmisCommand.PutText ("0.000162", STANDARD_DEVIATION, 0)

    Could this be the problem? If so, how do I fix it? Any other suggestions on how to get this to work properly? So far, I have tried every combination that I can think of....ID and Axis letter...ID, REF_ID, I am at a loss.

    Thanks.
Reply
  • So here is an example of what the program is saying:

    Set DmisCommand = DmisCommands.Add(DIMENSION_START_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = CIRC2 DIA
    retval = DmisCommand.PutText ("CIRC2 DIA", ID, 0)
    ' Set Reference Id = CIR2- OUTER CIRCLE ABOVE STEP
    retval = DmisCommand.PutText ("CIR2- OUTER CIRCLE ABOVE STEP", REF_ID, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Standard Deviation = 0.000300
    retval = DmisCommand.PutText ("0.000300", STANDARD_DEVIATION, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_D_LOCATION, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Nominal = 3.6460
    retval = DmisCommand.PutText (" 3.6460", NOMINAL, 0)
    ' Set Measured = 3.6433
    retval = DmisCommand.PutText (" 3.6433", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0020
    retval = DmisCommand.PutText (" 0.0020", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0020
    retval = DmisCommand.PutText (" 0.0020", F_MINUS_TOL, 0)
    ' Set Max = 3.6444
    retval = DmisCommand.PutText (" 3.6444", DIM_MAX, 0)
    ' Set Min = 3.6427
    retval = DmisCommand.PutText (" 3.6427", DIM_MIN, 0)
    ' Set Deviation = -0.0027
    retval = DmisCommand.PutText (" -0.0027", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0007
    retval = DmisCommand.PutText (" 0.0007", DIM_OUTTOL, 0)

    Set DmisCommand = DmisCommands.Add(DIMENSION_END_LOCATION, TRUE)
    DmisCommand.Marked = TRUE

    I have tried the ID and the REF_ID and I still get a zero reading, although this tells me that it is getting a measurement. But there is no set Axis in this section, but in the roundess there is:

    Set DmisCommand = DmisCommands.Add(DIMENSION_CIRCULARITY, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = CIR2 ROUNDNESS
    retval = DmisCommand.PutText ("CIR2 ROUNDNESS", ID, 0)
    ' Set Reference Id = CIR2- OUTER CIRCLE ABOVE STEP
    retval = DmisCommand.PutText ("CIR2- OUTER CIRCLE ABOVE STEP", REF_ID, 0)
    ' Set Unit Type = IN
    retval = DmisCommand.SetToggleString (1, UNIT_TYPE, 0)
    ' Set Graphic Analysis = OFF
    retval = DmisCommand.SetToggleString (1, GRAPH_ANALYSIS, 0)
    ' Set Textual Analysis = OFF
    retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 0)
    ' Set Arrow Multiplier = 10.000000
    retval = DmisCommand.PutText ("10.000000", ARROW_MULTIPLIER, 0)
    ' Set Output Type = BOTH
    retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
    ' Set Axis = M
    retval = DmisCommand.PutText ("M", AXIS, 0)
    ' Set Nominal = 0.0000
    retval = DmisCommand.PutText (" 0.0000", NOMINAL, 0)
    ' Set Measured = 0.0009
    retval = DmisCommand.PutText (" 0.0009", DIM_MEASURED, 0)
    ' Set Plus Tolerance = 0.0050
    retval = DmisCommand.PutText (" 0.0050", F_PLUS_TOL, 0)
    ' Set Minus Tolerance = 0.0000
    retval = DmisCommand.PutText (" 0.0000", F_MINUS_TOL, 0)
    ' Set Max = 0.0005
    retval = DmisCommand.PutText (" 0.0005", DIM_MAX, 0)
    ' Set Min = -0.0003
    retval = DmisCommand.PutText (" -0.0003", DIM_MIN, 0)
    ' Set Deviation = 0.0009
    retval = DmisCommand.PutText (" 0.0009", DIM_DEVIATION, 0)
    ' Set Out Tol = 0.0000
    retval = DmisCommand.PutText (" 0.0000", DIM_OUTTOL, 0)
    ' Set Standard Deviation = 0.000162
    retval = DmisCommand.PutText ("0.000162", STANDARD_DEVIATION, 0)

    Could this be the problem? If so, how do I fix it? Any other suggestions on how to get this to work properly? So far, I have tried every combination that I can think of....ID and Axis letter...ID, REF_ID, I am at a loss.

    Thanks.
Children
No Data