Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.19 KB

File metadata and controls

41 lines (31 loc) · 1.19 KB

Python part analysis

This command uses the local toolpath package to create a part, upload a STEP file, start analysis, listen until the report is ready, fetch feature datasheets, and print the complete report as JSON. Analysis progress is received from the Engine job SSE stream.

Install Python 3.11 or newer and uv. Then replace the example API key and file path below with your own values.

Windows PowerShell:

$env:TOOLPATH_API_KEY = "your-api-key"
uv run --project examples/python python examples/python/src/analyze_part.py "C:\path\to\part.step"

Windows Command Prompt:

set TOOLPATH_API_KEY=your-api-key
uv run --project examples/python python examples/python/src/analyze_part.py "C:\path\to\part.step"

macOS or Linux:

TOOLPATH_API_KEY="your-api-key" uv run --project examples/python python examples/python/src/analyze_part.py "/path/to/part.step"

The final output is the complete report returned by the API:

Analysis started as job 0195f02d-...
Analyzing geometry...
{
  "partId": "0195f02c-...",
  "jobId": "0195f02d-...",
  "features": []
}