This method executes a mini routine based on the mini routine's UID (unique ID).
Visual Basic |
---|
Public Sub ExecuteMiniRoutineByUID( _ ByVal UID As String, _ ByVal AlignmentDependencies As Boolean _ ) |
- 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.
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; } } } |