First live test with CATIA
Quick guide for the first test of CadPilot on a PC with CATIA V5 and GitHub Copilot – no administrator rights needed, takes about 45 minutes (5 of them automated).
Before you start: Save any open work of your own in CATIA. Use test models only, no customer or project data. The test creates its own parts and closes them at the end without saving; saving and export are only possible in the working folder (Safe Mode).
1. Preparation (5 min)
- Get the latest version (unzip the new ZIP file from Martin or run
git pull) and runscripts\setup_user.cmdagain. At the end it must say:ALL TESTS PASSED — 86 tools ready. - Start CATIA normally (not “Run as administrator”). Use the English user interface if possible; otherwise test anyway and note the language.
- Open a Command Prompt (
cmd, not as administrator) in the project folder and install the test tool once:.venv\Scripts\python.exe -m pip install "pytest>=7.0" mkdir docs\live
2. Automated tests (15 min)
All output goes to the folder docs\live. Do not use CATIA while the tests are running.
- Record the environment (read-only – CATIA version, service pack, Python):
The file must contain.venv\Scripts\python.exe scripts\live_env_report.py --catia --out docs\live\umgebung.json"status": "attached". If not, CATIA is not running or not running with the same rights – see section 5. - Acceptance test – checks items 2 to 11 of the checklist automatically (creates its own parts
MCP_Abnahme_*and closes them without saving) and writes the reportdocs\live\abnahme.md:
FAIL here means “finding found”, not “broken”. The acceptance test never starts CATIA itself – if no CATIA session is running, C1 reports “no running CATIA; not launched”. Please take a quick look at the report: if C1 does not show PASS, CATIA cannot be reached – see section 5. The line “Offen gebliebene Testdokumente” (test documents left open) lists.venv\Scripts\python.exe scripts\live_acceptance.py --out docs\live --record docs\live\abnahme.jsonlMCP_Abnahme_*parts that could not be closed – please close them in CATIA without saving. - Functional tests against CATIA with recording of the CATIA calls (paths are anonymised):
Failures are not a problem here – they are exactly the findings we are looking for. With a German user interface, tests may fail because of different feature names – please send the results anyway.set CATIA_MCP_RECORD=docs\live\aufzeichnung.jsonl .venv\Scripts\python.exe -m pytest tests\test_workflows.py --catia-live -rs -v > docs\live\tests.txt 2>&1 set CATIA_MCP_RECORD= - Surface test from the upstream project (creates a part, saves a test part and an image in the project folder):
.venv\Scripts\python.exe scripts\gsd_smoke_test.py > docs\live\gsd.txt 2>&1
3. Test with Copilot (20 min)
Open VS Code with the project folder, open .vscode\mcp.json and start the server catia-v5 there, then set Copilot Chat to Agent mode. Enter the prompts one after the other, confirm each tool call and enter the result in the checklist – and also check in CATIA.
- “Create a new part: plate 100 × 60 × 5 mm on the XY plane, centred on the origin. Give the volume, centre of gravity and bounding box.”
- “Sketch a circle with radius 10 in the centre of the XY plane and set a radius constraint of 12 mm.” → Check in CATIA: is it a radius constraint, and has the circle changed to R12?
- “New part: rectangle 100 × 60 on XY, then a 10 mm pad, mirrored extent. Give the volume.”
- “Show the journal and undo the last change.” → Check in CATIA: is the last feature gone?
- “Save the active part.” → Expected: refused (original/unsaved). Then: “Save a working copy as
Livetest_Platte.CATPartin the working folder.” - “Export the working copy as STEP to the working folder.”
4. Checklist
Rows 2–9 are already checked automatically by the acceptance test (see abnahme.md). Please still look in CATIA during the Copilot test (section 3) and fill them in – a person sees more than the measured values.
| # | Check | Expected | Result | Covers |
|---|---|---|---|---|
| 1 | Environment report | "status": "attached", CATIA release visible | ok | Connection |
| 2 | Plate volume | 30,000 mm³ (30 cm³) | ok | Basic function |
| 3 | Plate centre of gravity | x = 0, y = 0, z = 2.5 mm (or −2.5 if extruded towards −Z) – or the note “could not be measured”; never 0/0/0 without a note | ok | K9, K16 |
| 4 | Plate bounding box | 100 × 60 × 5 mm – or the error “could not be measured” | ok | K9, K16 |
| 5 | Radius constraint | Radius constraint R12 in CATIA, circle changed | ok | K8 |
| 6 | Pad, mirrored extent, 10 mm | 60,000 mm³ (total height 10) or 120,000 mm³ (10 per side) – please note the exact value | ____ mm³ | K15 |
| 7 | Undo | last feature deleted, everything else unchanged | ok | Journal |
| 8 | Saving the original | refused, with a pointer to the working folder | ok | Safe Mode |
| 9 | Working copy + STEP | both files in the working folder, nowhere else | ok | Safe Mode, export |
| 10 | Dialogs / hangs | none; if there are any: which dialog, at which step | none | Timeout |
5. If something does not work
| “no running CATIA instance” | Start CATIA; run CATIA and the Command Prompt both without admin rights. |
|---|---|
| “Invalid class string” (German Windows: “Ungültige Klassenzeichenfolge”) | CATIA is not registered for automation – IT has to do this once (see docs\ANLEITUNG_COPILOT.md). |
| Copilot shows no CATIA tools | Agent mode? Server started? With a company licence: policy “MCP servers in Copilot” (IT/GitHub admin). |
COM_TIMEOUT | Look in CATIA for an open dialog and close it; then carry on. |
| Program blocked by policy | Python in the user profile is blocked (AppLocker) – only IT can fix this. |
6. Send the results back
- Send the folder
docs\liveas a ZIP to Martin (containsumgebung.json,abnahme.md/abnahme.json,abnahme.jsonl,tests.txt,gsd.txt,aufzeichnung.jsonl). Thework-*subfolders with the test parts should not be included. - The completed checklist (a photo is fine) and Copilot’s answers to prompts 1, 3 and 4 (copied).
- Do not send any CATPart, STEP or image files. The recording contains names and dimensions of the test parts, but no paths.
Clean-up afterwards: the test part and image from the surface test in the project folder (GSD_SmokeTest*.CATPart, gsd_smoke_test.jpg) and the files in the working folder can be deleted.