hexagon logo

Set an active tip via code

Hi,

Does anybody have implemented setting an active tip via code?
It is equivalent to select a new tip from the Probe Tips pull-down list on PC-DMIS UI.

I am trying to do this using the following command, but I am not sure the suitable parameters.

objCommand = objPartProgram.Commands.Add(OBTYPE.SET_ACTIVE_TIP, true);

Please advise.​
Parents
  • This is what I did...

    1. Export the fundamental command(s) from PC-DMIS as BASIC script​

    Set DmisCommand = DmisCommands.Add(SET_ACTIVE_TIP, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = T1A0B0
    retval = DmisCommand.PutText ("T1A0B0", REF_ID, 0)
    ' Set Tip I = 0
    retval = DmisCommand.PutText ("0", TIP_I, 0)
    ' Set Tip J = 0
    retval = DmisCommand.PutText ("0", TIP_J, 0)
    ' Set Tip K = 1
    retval = DmisCommand.PutText ("1", TIP_K, 0)
    ' Set Theoretical Angle = 0
    retval = DmisCommand.PutText ("0", THEO_ANGLE, 0)​


    2. Find the constants in Visual Studio

    3. Migrate the code to Python

    PCD_OBTYPE_SET_ACTIVE_TIP = 60
    PCD_ENUM_FIELD_TYPES_REF_ID = 3
    PCD_ENUM_FIELD_TYPES_TIP_I = 229
    PCD_ENUM_FIELD_TYPES_TIP_J = 230
    PCD_ENUM_FIELD_TYPES_TIP_K = 231
    PCD_ENUM_FIELD_TYPES_THEO_ANGLE = 38​

    command = program.Commands.Add(PCD_OBTYPE_SET_ACTIVE_TIP, True)
    commandRet = command.PutText('T1A0B0', PCD_ENUM_FIELD_TYPES_REF_ID, 0)
    commandRet = command.EXECUTE​​
Reply
  • This is what I did...

    1. Export the fundamental command(s) from PC-DMIS as BASIC script​

    Set DmisCommand = DmisCommands.Add(SET_ACTIVE_TIP, TRUE)
    DmisCommand.Marked = TRUE
    ' Set Id = T1A0B0
    retval = DmisCommand.PutText ("T1A0B0", REF_ID, 0)
    ' Set Tip I = 0
    retval = DmisCommand.PutText ("0", TIP_I, 0)
    ' Set Tip J = 0
    retval = DmisCommand.PutText ("0", TIP_J, 0)
    ' Set Tip K = 1
    retval = DmisCommand.PutText ("1", TIP_K, 0)
    ' Set Theoretical Angle = 0
    retval = DmisCommand.PutText ("0", THEO_ANGLE, 0)​


    2. Find the constants in Visual Studio

    3. Migrate the code to Python

    PCD_OBTYPE_SET_ACTIVE_TIP = 60
    PCD_ENUM_FIELD_TYPES_REF_ID = 3
    PCD_ENUM_FIELD_TYPES_TIP_I = 229
    PCD_ENUM_FIELD_TYPES_TIP_J = 230
    PCD_ENUM_FIELD_TYPES_TIP_K = 231
    PCD_ENUM_FIELD_TYPES_THEO_ANGLE = 38​

    command = program.Commands.Add(PCD_OBTYPE_SET_ACTIVE_TIP, True)
    commandRet = command.PutText('T1A0B0', PCD_ENUM_FIELD_TYPES_REF_ID, 0)
    commandRet = command.EXECUTE​​
Children
No Data