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.
  • This still gives me a null reading. Disappointed Gonna try a few ideas from yesterday and let you know what happens.
  • Try
    DimMeas = ObjCmd.GetText (DIM_MEASURED, 0)
  • I discovered something...I have two planes in the program that I am trying to pull the measurements of. One, PLANE5, is a constructed plane and I can pull that data with the MeasZ variable as the GetText(MEAS_Z,0) command. But PLANE4, the one I am having issues with is a measured plane, since a measured diameter is StrDimDiameter = ObjCmd.FeatureCommand.MeasDiam, would a measured plane be StrDimPlane = ObjCmd.FeatureCommand.MeasPlane?
  • Try
    DimMeas = ObjCmd.GetText (DIM_MEASURED, 0)



    Thanks vpt.se, but I tried that last night and it gave me a zero for the read out. Maybe I called it out wrong. I noticed that this is a measured plane earlier in the program, which is a feature command and I think I put this under dimension commands. Would that make a difference?
  • Thanks vpt.se, but I tried that last night and it gave me a zero for the read out. Maybe I called it out wrong. I noticed that this is a measured plane earlier in the program, which is a feature command and I think I put this under dimension commands. Would that make a difference?


    The code I referred to (DIM_MEASURED) only works with dimensions, in this case the DIMENSION_Z_LOCATION.
  • The code I referred to (DIM_MEASURED) only works with dimensions, in this case the DIMENSION_Z_LOCATION.


    I have tried this both ways, and got nothing. I have to be missing something.

    In one part of the code, that plane is refered to as plane4- top of baffle (or something like that) and here it is plane4 z. The top of baffle plane is a measured plane and using the measz command doesn't work. That is the one I started with. Using that with the plane4 z doesn't work. Using the dim measured with either one or as a feature or dimension does not work.

    Is there away to call this measurement out by using the feature command MEASURED_PLANE? There must be a way to get that measurement out of there and in the format I need it, but I just don't know it.

    Oh, and I did find out there is no measplane command either. Smiley.
  • I have also tried working with the GetFieldText command, but when I follow the format suggested in the help files, all I get is an error of not specified block or with block. I am ready to start beating my head against the desk.
  • Kelly,
    This might not help, but it is good practice for the future.

    PCDMIS prefers <demands> Feature Names, etc to have ONLY alphanumeric characters (letters, numbers) and the underscore key. Sometimes other characters work, but why tempt the demon.

    no spaces, + or - signs. It gets confused and performs math functions.

    good luck on your coding.
  • Kelly,
    This might not help, but it is good practice for the future.

    PCDMIS prefers <demands> Feature Names, etc to have ONLY alphanumeric characters (letters, numbers) and the underscore key. Sometimes other characters work, but why tempt the demon.

    no spaces, + or - signs. It gets confused and performs math functions.

    good luck on your coding.


    Here is kind of the situation on this. I know nothing about programming PCDMIS, never attended a class, have not had any training. But have been thrown in on this project to get this OLE to communicate between PCD and WinSPC simply because I have programming experience, but not in VB. So, all the PCDMIS programs have been created by others, and in the case of this place, many others and I have no control over how they were put together or if they ever get fixed. I am stuck with what I have.

    But, with that in mind, I will keep that in mind if I ever get the chance to change any of these and do them properly (if I ever figure out what proper is). Slight smile