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
  • First you are looking for preset command ID's, if none of these match, you check if the command is a feature and if it is, you fetch the MeasDiam.
    What if the feature in question is a line or a plane? I don't think they have the property MeasDiam since these are not diameters. Chances are that it will error out...

    The exported program is basically now a script. If you execute the script within PC-DMIS, it will (should) create the program you exported.

    If you once found a circle feature command through your code, you can get the diameter through this:

    myDiam = PCDCommand.GetText(MEAS_DIAM, 0)


    And fetch the X-coordinate (as an example) through this:

    mX = PCDCommand.GetText(MEAS_X, 0) ' measured
    tX = PCDCommand.GetText(THEO_X, 0) ' theoretical
Reply
  • First you are looking for preset command ID's, if none of these match, you check if the command is a feature and if it is, you fetch the MeasDiam.
    What if the feature in question is a line or a plane? I don't think they have the property MeasDiam since these are not diameters. Chances are that it will error out...

    The exported program is basically now a script. If you execute the script within PC-DMIS, it will (should) create the program you exported.

    If you once found a circle feature command through your code, you can get the diameter through this:

    myDiam = PCDCommand.GetText(MEAS_DIAM, 0)


    And fetch the X-coordinate (as an example) through this:

    mX = PCDCommand.GetText(MEAS_X, 0) ' measured
    tX = PCDCommand.GetText(THEO_X, 0) ' theoretical
Children
No Data