PC-DMIS 2021.1 Object Library
ExecuteMiniRoutineByUID Method
See Also  Example  Send Topic Feedback | See Object Hierarchy Chart
UID
This string defines the unique ID of the mini routine to execute. You can get the UID from the .xml file that PC-DMIS creates when you create the mini routine.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.
PCDLRN ActiveX DLL > PartProgram Object : ExecuteMiniRoutineByUID Method

Glossary Item Box

Description

This method executes a mini routine based on the mini routine's UID (unique ID).

Syntax

Visual Basic
Public Sub ExecuteMiniRoutineByUID( _
   ByVal UID As String, _
   ByVal AlignmentDependencies As Boolean _
) 

Parameters

UID
This string defines the unique ID of the mini routine to execute. You can get the UID from the .xml file that PC-DMIS creates when you create the mini routine.
AlignmentDependencies
This determines if the mini routine also executes features required to create the alignment.

Example

This example, shows how to use the ExecuteMiniRoutineByUID method to execute some mini routines from some UIDs:
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.ExecuteMiniRoutineByUID("585468144", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByUID("585478448", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByUID("589656056", true);
      waitForExecutionToComplete();

      part.ExecuteMiniRoutineByUID("665062208", 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 © 2020. Hexagon Manufacturing Intelligence – Metrology Software, Inc. All Rights Reserved.