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.
Visual Basic |
---|
Public Function GetNext() As Command |
Command object of the next command.
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(); } |