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
  • This is good. You can use VB in Excel to do all your development/debugging and more importantly, learn the pcdmis type library. You can set breakpoints, watches, step through your code line-by-line. While in debug mode, you can hover the mouse over a variable name and a tooltip will popup showing the contents. It's very powerful - I'd recommend picking up a book on VBA to help learn about the programming interface. Be sure to check out the Object Browser - you can set it to show only the pc-dmis objects and it's a great way to get a feel for the object hierarchy.

    You'll need to set a reference to the pc-dmis type library in your project (Tools/References - scroll WAY down to the "p's" and check the pc-dmis library)
    Add a module (Insert/Module) and paste your code into the module window (minus the form stuff)
    Lastly, change Object declarations to the 'real' object type - like this:
    Dim ObjApp as Application
    Dim ObjPart as PartProgram
    Dim ObjCmds as Commands
    Dim ObjCmd as Command
    Dim ObjDimCmd as DimensionCommand
    etc...
    


    Once you're all finished debugging and are "production-ready" you'll have to change the declarations back to "Object" for use as pc-dmis script.

    I really think that going this route will help you learn/understand the pc-dmis objects.


    Thank you, I will definitely do it. Anything to make this easier. Slight smile There are days that I just want to beat my head against the wall.

    Add: Thank you so much, I have just started playing with it, and already I can see how useful this is. I wish I knew about this earlier. Slight smile Fun, I now have new toys.
Reply
  • This is good. You can use VB in Excel to do all your development/debugging and more importantly, learn the pcdmis type library. You can set breakpoints, watches, step through your code line-by-line. While in debug mode, you can hover the mouse over a variable name and a tooltip will popup showing the contents. It's very powerful - I'd recommend picking up a book on VBA to help learn about the programming interface. Be sure to check out the Object Browser - you can set it to show only the pc-dmis objects and it's a great way to get a feel for the object hierarchy.

    You'll need to set a reference to the pc-dmis type library in your project (Tools/References - scroll WAY down to the "p's" and check the pc-dmis library)
    Add a module (Insert/Module) and paste your code into the module window (minus the form stuff)
    Lastly, change Object declarations to the 'real' object type - like this:
    Dim ObjApp as Application
    Dim ObjPart as PartProgram
    Dim ObjCmds as Commands
    Dim ObjCmd as Command
    Dim ObjDimCmd as DimensionCommand
    etc...
    


    Once you're all finished debugging and are "production-ready" you'll have to change the declarations back to "Object" for use as pc-dmis script.

    I really think that going this route will help you learn/understand the pc-dmis objects.


    Thank you, I will definitely do it. Anything to make this easier. Slight smile There are days that I just want to beat my head against the wall.

    Add: Thank you so much, I have just started playing with it, and already I can see how useful this is. I wish I knew about this earlier. Slight smile Fun, I now have new toys.
Children
No Data