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.
  • So, next dumb question...is FCF and Xact Measure and GD&T all the same thing?
  • And as far as the error goes, I found it. I was missing an End If in those If, Then statements specifying where the information should go. Slight smile
  • So, next dumb question...is FCF and Xact Measure and GD&T all the same thing?


    Xactmeasure is the reporting of features (specified by GD&T) using Feature Control Frames.

    (I never use it)
  • Xactmeasure is the reporting of features (specified by GD&T) using Feature Control Frames.

    (I never use it)


    I wish we never used it, but we have 2 parts in the whole plant that does. So now I have another thing to add to my list of things to figure out.

    Since something that is specified as a DIMENSION_Z_LOCATION, or Y loc, or X loc doesn't have an ID in that block of commands, would it help if I set the ID to be that of the previous ID. Could the fact that the program is looking for an ID that doesn't exist make it return a null value?
  • If (ObjDimCmd.Type = DIMENSION_TRUE_END_POSITION) Then


    Maybe?

    Try
    If (ObjDimCmd.Type = DIMENSION_END_TRUE_POSITION) Then


    DIMENSION_TRUE_END_POSITION is correct.

    There is an error here though. 'Type' is not a member of DimensionCommand, it is a member of Command. It should be:
    If (ObjCmd.Type = DIMENSION_TRUE_END_POSITION) Then

  • [COLOR=#ff0000]For ix = 1 To ObjCmds.Count[/COLOR]
    Set ObjCmd = ObjCmds(ix)
    
    [COLOR=#ff0000]For Each ObjCmd in ObjCmds[/COLOR]
    .
    .
    .
    .


    Yikes - don't do this! You have nested loops that scan through the entire program. So, if the program has 10,000 commands, you are going to scan through the entire program 10,000 times. Use one technique or the other, not both.
  • Yikes - don't do this! You have nested loops that scan through the entire program. So, if the program has 10,000 commands, you are going to scan through the entire program 10,000 times. Use one technique or the other, not both.


    Good to know. Thanks. I guess I didn't realize that I was scanning it that way.
  • DIMENSION_TRUE_END_POSITION is correct.

    There is an error here though. 'Type' is not a member of DimensionCommand, it is a member of Command. It should be:
    If (ObjCmd.Type = DIMENSION_TRUE_END_POSITION) Then


    Because it mentions dimension in the code it is a command but if it is a dimension it is a dimensioncommand? Obviously, I am still trying to figure this all out.

    And then if I am using a command fuction, it should not appear under the if objcmd.is... statement?

    I know, dumb questions.

    Oh, and don't just generally set the id as if id = "" then id = previd; previd = strdimid. It sends it into a loop that makes all the id's the same as whatever id you have first. It was a bad experiement.
  • Random questions (related to easier ways to learn the pcdmis type library). Do you have a acess to an offline seat of pc-dmis? If so, do you have access to vb6 or excel on that computer?

  • Since something that is specified as a DIMENSION_Z_LOCATION, or Y loc, or X loc doesn't have an ID in that block of commands, would it help if I set the ID to be that of the previous ID. Could the fact that the program is looking for an ID that doesn't exist make it return a null value?


    The code that AndersI posted handles this problem. If it isn't working, you need to review how you've integrated it into your code.

    Edit: sorry, no it doesn't. He is not outputting dimension names.