PC-DMIS 2021.1 Object Library
GetNext Method
See Also  Example  Send Topic Feedback | See Object Hierarchy Chart
PCDLRN ActiveX DLL > Command Object : GetNext Method

Glossary Item Box

Description

This method returns a new instance of the command that follows the current command in the Commands object. Unlike Next, this method does not change the current command but instead returns a new Command object.

Syntax

Visual Basic
Public Function GetNext() As Command

Return Type

Command object of the next command.

Example

This method, returns the next command, and shows it's description and id.
Example (C#)Copy Code
private void UseGetNextButton_Click(object sender, EventArgs e)
    {
      if (theApp == null || theApp.ActivePartProgram == null)
      {
        AddMessage(@"UseGetNextButton_Click: theApp == null || theApp.ActivePartProgram == null)");
        return;
      }

      AddMessage(@" ");
      AddMessage(@"---------------------------------------------------------------------------");

      var commands = theApp.ActivePartProgram.Commands;
      var startCommand = commands.Item(1);
      var count = 0;
      var iterCommand = startCommand.GetNext();
      int startHiPart = 0;
      int startLoPart = 0;
      startCommand.GetUniqueID(ref startHiPart, ref startLoPart);
      var methodName = @"GetNext()";
      AddMessage($@"Using {methodName} method. StartCommand <{startCommand.TypeDescription}> Uid<{startHiPart}:{startLoPart}>");

      while (iterCommand != null)
      {
        count++;
        CompareCommands(iterCommand, methodName, count, startCommand, startHiPart, startLoPart);
        iterCommand = iterCommand.GetNext();
      }

      AddMessage(@"---------------------------------------------------------------------------");
      AddMessage(@" ");

      GC.Collect();
    }

See Also

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