git clone https://github.com/HyeonjeYang/AutodeskPyInventor.git
cd AutodeskPyInventor
python -m pip install -e ".[dev]"Check that your machine is ready (works even without Inventor open):
autodesk-pyinventor doctor --strictGenerate a washer (OD 80mm, ID 25mm, thickness 8mm) as a native .ipt and a 3D-printable .stl:
autodesk-pyinventor disk --od 80 --id 25 --thickness 8 --output generated\washer.ipt --stl generated\washer.stlAdd --dry-run --json to any command to print the plan as JSON without starting Inventor:
autodesk-pyinventor disk --od 80 --id 25 --thickness 8 --dry-run --jsonRequirements: Windows + Autodesk Inventor for real part generation. Python 3.10+ everywhere else (planning, validation, and
pytestall run cross-platform).
projects/micro_drone_project/ is a complete real-world build (frame, motors, propellers, electronics, and assembly) generated entirely through this library. See its PRINT_AND_ASSEMBLY.md for the build script commands and print/assembly steps.
| Command | Description |
|---|---|
doctor |
Diagnose local Inventor COM, Python, and template readiness |
disk / washer |
Generate solid disks or bored washers |
tube |
Generate straight hollow tubes |
flanged-tube |
Generate tubes with mounting flanges |
barn-door-star-tracker |
Generate a barn-door star tracker part set |
astro-kit-addons |
Generate add-on parts for the Astro Kit |
Run autodesk-pyinventor <command> --help for each command's full argument list.
Raw CAD COM APIs are stateful and brittle — an easy way for an LLM-driven script to hang or crash Inventor mid-run. AutodeskPyInventor avoids that with a declarative, functional layer:
- Plain-data plans: agents compose immutable dataclasses (
RectangleExtrude,CircleExtrude,PolygonExtrude, ...) instead of calling raw COM methods. - Offline validation: geometry math, clearances, and JSON plans validate in milliseconds via
pytestor--dry-run— no Inventor required, safe for CI/sandboxes. - Single-pass execution: once validated,
InventorBackendexecutes the whole plan in one reliable pass.
from autodesk_pyinventor.plan import FeaturePlan, CircleExtrude, RectangleExtrude
from autodesk_pyinventor.part import Part
from autodesk_pyinventor.app import connect
# 1. Compose a declarative plan
plan = FeaturePlan(
name="sensor_mount",
operations=[
RectangleExtrude(width_mm=40.0, height_mm=30.0, x_mm=0, y_mm=0, z_mm=0, length_mm=5.0, operation="join"),
CircleExtrude(diameter_mm=12.0, x_mm=0, y_mm=0, z_mm=-0.5, length_mm=6.0, operation="cut"),
],
)
# 2. Validate offline, no Inventor needed
plan.validate()
# 3. Execute in one pass
app = connect(visible=True)
part = Part.from_plan(app=app, plan=plan, path="generated/sensor_mount.ipt")
part.save()
part.export_stl("generated/sensor_mount.stl")# Fast offline unit tests (no Inventor required)
pytest
# Live Inventor COM integration tests (Windows + Inventor only)
$env:AUTODESK_PYINVENTOR_RUN_INTEGRATION=1
pytest tests\integrationSee docs/troubleshooting.md if doctor reports a problem.
- src/autodesk_pyinventor/ — the library:
plan.py(geometry AST),backend.py(COM execution),recipes.py(parametric recipes),cli.py. - examples/ — short single-file usage scripts.
- projects/micro_drone_project/ — a full demo build (multi-part, assembly, print guide).
- docs/ — design notes, Inventor COM quirks, troubleshooting, architecture notes.
- tests/ —
unit/(no Inventor required) andintegration/(opt-in, needs Inventor).
- No secrets, credentials, or telemetry are used anywhere in this project.
- Generated CAD artifacts (
.ipt,.iam,.stl, etc.) and thegenerated/folder are git-ignored — nothing you build locally gets committed. - This library only automates the local Inventor COM application; it makes no network calls.
MIT License. Copyright (c) 2026 HyeonjeYang.
Not affiliated with, endorsed by, or sponsored by Autodesk, Inc. Autodesk and Autodesk Inventor are registered trademarks of Autodesk, Inc.
RevolveFeature: 360° rotational extrusions around axes for axisymmetric components (engine nozzles, shafts, rounded housings, bushings).Loft&Sweep: Smooth cross-sectional morphing (e.g., square-to-round aerodynamic ducting) and path-following sweeps for complex tubing/wiring conduits.Fillet&Chamfer: Declarative edge-blending operations for automated stress-concentration relief and ergonomic surface finishing.CircularPattern&RectangularPattern: High-performance feature replication (e.g., bolt circles, multi-arm drone frames, gear teeth) without manual coordinate trigonometry.
- Autodesk Inventor
StressAnalysis/ Nastran COM Integration: Direct COM triggers for automated tetrahedral meshing, boundary constraint application, 3D von Mises stress tensor solving, and headless screenshot rendering of color stress heatmaps. - Automated Generative Optimization Loops: Autonomous CAD -> FEA -> Geometry Reinforcement -> Re-verification loops driven by AI Coding Agents.
- Generalized 3D Assembly Constraints: Declarative
Mate,Flush,Insert, andTangentjoints with 6-DOF spatial matrix transformations. - Automated Clearance & Interference Checking: Programmatic collision detection between rotating parts (e.g., propeller-to-duct clearance verification).