PcdmisObjectModel 21.1.0

dotnet add package PcdmisObjectModel --version 21.1.0
                    
NuGet\Install-Package PcdmisObjectModel -Version 21.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PcdmisObjectModel" Version="21.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PcdmisObjectModel" Version="21.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PcdmisObjectModel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PcdmisObjectModel --version 21.1.0
                    
#r "nuget: PcdmisObjectModel, 21.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PcdmisObjectModel@21.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PcdmisObjectModel&version=21.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PcdmisObjectModel&version=21.1.0
                    
Install as a Cake Tool

PcdmisObjectModel

A COM-free object model and automation facade over PC-DMIS (PCDLRN). It lets .NET applications read, edit, write back, and execute PC-DMIS part programs through a strongly typed model and a clean async API, without ever touching a COM type directly.

Requirements

  • .NET Framework 4.8
  • x64 only — PC-DMIS COM is 64-bit, so consuming projects must run as x64.
  • A registered PC-DMIS installation on the machine at runtime. The PCDLRN COM interop types are embedded into this assembly, but the actual implementation is provided by the installed PC-DMIS application.

Installation

Install-Package PcdmisObjectModel

Newtonsoft.Json is pulled in automatically as a dependency.

What's inside

  • MeasurementRoutine — a strongly typed model of a part program: metadata plus an Elements collection of commands (features, alignments, dimensions, moves, scans, parameter changes, flow control, reports, and more).
  • PcdmisAutomationSession — a COM-free facade over the running PC-DMIS instance, with both synchronous and *Async methods. All COM calls are funnelled onto a dedicated STA worker thread, so UI threads never block and connection-point events are delivered correctly.
  • JSON serializationRoutineJsonSerializer (and MeasurementRoutine.ToJson / SaveToJson / FromJson / LoadFromJson) preserve the polymorphic command tree so a routine can be stored and reloaded offline.
  • Application events — COM-free .NET events such as PartProgramOpened/Closed/Saved, ProgramExecutionStarting/Ended, MachineConnected/Disconnecting, and StatusMessageUpdated.

Quick start

using PcdmisObjectModel;

var session = new PcdmisAutomationSession();

// Connect to a running PC-DMIS instance.
string error = await session.ConnectAsync();
if (error != null) { /* handle connection failure */ }

// Surface PC-DMIS status messages.
session.StatusMessageUpdated += (s, e) => Console.WriteLine(e.Message);

// Load the active part program into a strongly typed routine.
RoutineResult result = await session.LoadActiveRoutineAsync();
if (result.Success)
{
    MeasurementRoutine routine = result.Routine;
    foreach (var element in routine.Elements)
        Console.WriteLine($"{element.ID} ({element.GetType().Name})");

    // Persist offline as JSON.
    routine.SaveToJson(@"C:\temp\routine.json");

    // Push edits back into the active part program (replaces its commands).
    await session.SyncRoutineToActiveProgramAsync(routine);

    // Save the active program in place.
    await session.SaveActiveRoutineAsync();
}

Notes

  • SyncRoutineToActiveProgram replaces the commands in the active part program with the routine's elements and leaves the program open (not saved). Call SaveActiveRoutine to persist.
  • Executing a routine drives real machine motion when PC-DMIS is connected to a CMM. Make sure the correct part is loaded and the path is clear.

License / Author

Author: WU Dimin

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
21.1.0 154 6/23/2026