Accessing Inventor Apprentice Server with PowerShell

by Chandra shekar Gopal,

📌 Issue

Many developers and IT professionals seek lightweight ways to extract metadata from Autodesk Inventor files without launching the full Inventor application. A common scenario involves retrieving iProperties from part files using scripting languages such as PowerShell.

✅ Solution

Autodesk Inventor Apprentice Server provides a powerful COM interface that allows you to read Inventor file data—including iProperties—without opening the Inventor UI. This is ideal for batch processing, automation scripts, and headless environments.

Below is a PowerShell script example demonstrating how to use Apprentice Server to open a .ipt part file and display its Part Number iProperty.

💻 PowerShell Script: Read Part Number from IPT File


# Create the ApprenticeServer object
$apprentice = New-Object -ComObject Inventor.ApprenticeServer

# Open the specified Inventor part file
$apprenticeDoc = $apprentice.Open("C:\Temp\Part1.ipt")

# Retrieve and print the Part Number iProperty
Write-Host $apprenticeDoc.PropertySets.
    Item("Design Tracking Properties").
    Item("Part Number").
    Value

# Clean up the COM object
[System.Runtime.InteropServices.Marshal]::ReleaseComObject($apprentice) | Out-Null

🔍 Explanation

  • New-Object -ComObject Inventor.ApprenticeServer: Creates an instance of the Apprentice Server.
  • .Open("C:TempPart1.ipt"): Opens the specified IPT file for read access.
  • .PropertySets.Item("Design Tracking Properties").Item("Part Number").Value: Accesses the Part Number iProperty.
  • ReleaseComObject: Properly releases the COM object to avoid memory leaks.

🛠️ Products and Versions Supported

This approach applies to the following versions of Autodesk Inventor where Apprentice Server is available:

  • Inventor 2021
  • Inventor 2022
  • Inventor 2023
  • Inventor 2024
  • Inventor 2025
  • Inventor 2026 (Note: Requires separate installation of Apprentice Server). 

⚠️ Notes

  • In Inventor 2026, Apprentice Server is no longer registered by default and must be installed separately. Refer this blog for more details on Inventor Apprentice Server Enhancement in Inventor 2026 
  • Running PowerShell as Administrator may be required depending on system policies.

📘 Additional Resources


Comments

2 responses to “Accessing Inventor Apprentice Server with PowerShell”

  1. Klaus KApeller Avatar
    Klaus KApeller

    Hi,
    I am a senior developper for a lot of Autodesk products.
    I face a problem with the Inventor Apprentice Server 2025
    Opening a document with the Apprentice Server using OptionWithOptions does not work:
    $OpenOptions = $ApprenticeServer.TransientObjects.CreateNameValueMap()
    $OpenOptions.Add(“DesignViewRepresentation”, “Test”)
    $OpenOptions.Add(“ModelState”, “Layout”)
    $ThisApprenticeDocument = $ApprenticeServer.OpenWithOptions($MainFileName, $OpenOptions)
    Value does not fall within the expected range.
    At line:1 char:1
    + $ThisApprenticeDocument = $ApprenticeServer.OpenWithOptions($MainFile …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException
    A view “Test” and a ModelState “Layout” exists in my assembly!
    I don’t find any good examples or Helpfiles for the approientice
    OpenWithOptions with the Inventor App itself woirks with theses parameters.
    Any ideas?
    Thanks a lot
    Klaus

  2. Chandra shekar Gopal Avatar
    Chandra shekar Gopal

    Hi Klaus,
    Thank you for sharing the details of the issue. To assist with further investigation, could you please create a simplified, non-confidential version of your assembly files that still reproduces the problem, post it in the Inventor Forum, and share the link with us?
    This will enable the community and our team to review the case in more detail and work toward a solution.
    Thanks and regards,
    Chandra shekar G

Leave a Reply to Chandra shekar GopalCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading