PC-DMIS 2022.1 Object Library
ExecuteMiniRoutineByNameArray Method
See Also  Example  Send Topic Feedback | See Object Hierarchy Chart
NameArray
This array contains a list of mini routine names to execute.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.
PCDLRN ActiveX DLL > PartProgram Object : ExecuteMiniRoutineByNameArray Method

Glossary Item Box

Description

This method executes multiple mini routines contained within an array of strings. Each item in the array is a mini routine name.

Syntax

Visual Basic
Public Function ExecuteMiniRoutineByNameArray( _
   ByVal NameArray As StringArray, _
   ByVal AlignmentDependencies As Boolean _
) As Boolean

Parameters

NameArray
This array contains a list of mini routine names to execute.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.

Return Type

Returns True if the method succeeds and False otherwise.

Example

This shows how to create string arrays of mini routine names and of UIDs (unique IDs) and how to execute them:
Example (C#)Copy Code
using PCDLRN;

namespace ConsoleApplication1
{
  class Program
  {
    static bool IsExecuting { get; set; }

    static void Main(string[] args)
    {
      var app = new Application {Visible = true};
      var part = app.ActivePartProgram;

      if (part == null) return;
      part.PartProgramSettings.MiniroutineSettings.FbmMarkingMode = true;
      part.PartProgramSettings.MiniroutineSettings.ManualAlignFeaturesStatus = true;

      part.OnStartExecution += part_OnStartExecution;
      part.OnEndExecution += part_OnEndExecution;

      var stringArray = part.GetStringArray();
      stringArray.SetSize(4);
      stringArray.SetValue(1, "OP10");
      stringArray.SetValue(2, "MiniRoutine2");
      stringArray.SetValue(3, "MiniRoutine3");
      stringArray.SetValue(4, "MiniRoutine4");

      if (part.ExecuteMiniRoutineByNameArray(stringArray, true, true))
      {
        waitForExecutionToComplete();
      }

      var stringArray2 = part.GetStringArray();
      stringArray2.SetSize(4);
      stringArray2.SetValue(1, "585468144");
      stringArray2.SetValue(2, "585478448");
      stringArray2.SetValue(3, "589656056");
      stringArray2.SetValue(4, "665062208");

      if (part.ExecuteMiniRoutineByUIDArray(stringArray2, true, true))
      {
        waitForExecutionToComplete();
      }
    }

    static void waitForExecutionToComplete()
    {
      while (IsExecuting)
      {
        // Do nothing
      }
    }

See Also

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