PC-Dmis 2010 Object Library | Send comments on this topic. | See Object Hierarchy Chart
FindByUniqueID Method
See Also

Collapse All Expand All

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.

# Description

Finds the command identified by the unique id formed from low and high parts

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 part program is already open

Set Part = App.ActivePartProgram

' Get the entire list of commands in the part program

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 part program

For Each Cmd In Cmds

' Find the first assignment command in the part program

' 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 part program

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

ExecutedCommands Object | GetUniqueID Method

© Wilcox Associates, Inc. All Rights Reserved.

© 2010 All Rights Reserved.