PC-DMIS 2021.1 Object Library
FindByUniqueID Method
See Also  Send Topic Feedback | See Object Hierarchy Chart
HiPart
This parameter is a Long value that should come from a call to GetUniqueID made previously on the desired command object.
LoPart
This parameter is a Long value that should come from a call to GetUniqueID made previously on the command object.
PCDLRN ActiveX DLL > ExecutedCommands Object : FindByUniqueID Method

Glossary Item Box

Description

Finds a command by a unique ID using HighPart and LoPart parameters.

Syntax

Visual Basic
Public Function FindByUniqueID( _
   ByVal HiPart As Long, _
   ByVal LoPart As Long _
) As Command

Parameters

HiPart
This parameter is a Long value that should come from a call to GetUniqueID made previously on the desired command object.
LoPart
This parameter is a Long value that should come from a call to GetUniqueID made previously on the command object.

Return Type

Command object.

Remarks

You will need to use the GetUniqueID method in order to get the HiPart and LoPart parameter values.

Example

Dim App As PCDLRN.Application

' Get the application object via CreateObject

Set App = CreateObject("PCDLRN.Application")

Dim Part As PCDLRN.PartProgram

' Assume measurement routine is already open

Set Part = App.ActivePartProgram

' Get the entire list of commands in the measurement routine

Dim Cmds As PCDLRN.Commands

Set Cmds = Part.Commands

Dim Cmd As PCDLRN.Command

' Declare variables for holding the unique id values

Dim HiPart As Long, LoPart As Long

' Loop through all of the commands in the measurement routine

For Each Cmd In Cmds

' Find the first assignment command in the measurement routine

' And save off the unique id for that command

If Cmd.Type = ASSIGNMENT Then

Cmd.GetUniqueID HiPart, LoPart

Exit For

End If

Next Cmd

' Execute the measurement routine

Part.EXECUTE

Dim ExecutedCmds As PCDLRN.ExecutedCommands

' Obtain the set of execute commands

Set ExecutedCmds = Part.ExecutedCommands

' Check to see if assignment executed

Set Cmd = ExecutedCmds.FindByUniqueID(HiPart, LoPart)

If Not Cmd Is Nothing Then

MsgBox "Assignment command executed"

End If

See Also

Copyright © 2020. Hexagon Manufacturing Intelligence – Metrology Software, Inc. All Rights Reserved.