PC-DMIS 2021.2 Object Library
ExecuteMiniRoutineByName Method
See Also  Example  Send Topic Feedback | See Object Hierarchy Chart
Name
This string defines the name of the mini routine to execute.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.
PCDLRN ActiveX DLL > PartProgram Object : ExecuteMiniRoutineByName Method

Glossary Item Box

Description

This method executes a mini routine based on the mini routine's name.

Syntax

Visual Basic
Public Sub ExecuteMiniRoutineByName( _
   ByVal Name As String, _
   ByVal AlignmentDependencies As Boolean _
) 

Parameters

Name
This string defines the name of the mini routine to execute.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.

Example

This example, shows how to use the ExecuteMiniRoutineByName method to execute some mini routines from some names:
Example (C#)Copy Code
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
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.OnStartExecution += part_OnStartExecution;
      part.OnEndExecution += part_OnEndExecution;

      part.ExecuteMiniRoutineByName("OP10", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByName("MiniRoutine2", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByName("MiniRoutine3", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByName("MiniRoutine4", true);
      waitForExecutionToComplete();
    }

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

    static void part_OnStartExecution()
    {
      IsExecuting = true;
    }

    static void part_OnEndExecution(int terminationType)
    {
      IsExecuting = false;
    }
  }
}

See Also

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