Skip to content

Manage Tooling Catalog

KaiUR edited this page Jul 20, 2026 · 1 revision

Manage Tooling Catalog

File: Process_Document_Scripts/Manage_Tooling_Catalog.py
Version: 1.0
Document Type: None — CATIA must be running, but no document need be open


Description

A grid (spreadsheet) editor for CATIA NC tooling catalogs. Pick a resource chapter (NC_TOOLS, NC_INSERTS, NC_TOOL_ASSEMBLIES, NC_CORRECTORS) and a tool-type family, and that family's real CATIA keyword columns load into an editable grid. Tools are rows: add, duplicate, delete, edit cells inline, and add extra keyword columns.

The whole tree is saved as a single CSV in CATIA's batch-catalog format, and the .catalog is built from it. CATIA exposes no automation to edit an existing .catalog in place, so the CSV is the source of truth and the catalog is rebuilt from it each time.

The catalog is written with the full NC_RESOURCES tree — every resource chapter and every tool family, whether or not it holds any tools — as a hand-built tooling catalog has.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.10.0
wxPython Required
xlsxwriter Not required
Open document None — CATIA running is enough
CATIA macros Must be permitted; Build runs a generated macro

Usage

  1. Start CATIA — no document needs to be open
  2. Run the script
  3. Choose a chapter and a tool family from the dropdowns
  4. Edit tools in the grid:
    • Add Row / Duplicate Row / Delete Row
    • Add Column to add a keyword the family list is missing
    • Browse CATPart Path (or double-click a CATPart Path cell) to link the part that physically represents the tool
  5. Save CSV writes the whole tree in CATIA's batch-catalog format
  6. Load CSV reads a saved catalog CSV back into the grid
  7. Build Catalog creates the .catalog

The catalog structure

The built catalog has the standard tooling layout:

NC_RESOURCES
├── NC_TOOLS
│   ├── MfgDrillTool
│   ├── MfgEndMillTool
│   └── ... (all tool families)
├── NC_INSERTS
├── NC_TOOL_ASSEMBLIES
└── NC_CORRECTORS

Empty chapters and empty families are still created, so the catalog is complete and ready to be filled later.


Keyword types

Keyword types are taken from the batch catalogs CATIA ships in <CATIA>\win_b64\startup\Manufacturing\Samples. CATIA types dimensional keywords with unit tokens, not Real:

Type token Meaning Example keyword
mm Length MFG_NOMINAL_DIAM
deg Angle MFG_MAX_PLNG_ANG
s Time MFG_MAX_MIL_TIME
m_mn Velocity MFG_VC_ROUGH
mm_mn Linear feed rate MFG_MAX_FEEDRATE
mm_turn Angular feed rate MFG_SZ_ROUGH
String / Integer / Boolean MFG_NAME, MFG_TOOL_NUMBER, MFG_BALL_TYPE

Keywords not covered by CATIA's samples fall back to a unit-aware guess based on the keyword name.


Editing aids

  • Dropdowns on keywords with a fixed value set (MFG_WAY_OF_ROT, MFG_MACH_QUALITY, MFG_COMPOSITION, MFG_TOOTH_MAT) and on boolean keywords (TRUE / FALSE). The list opens on a single click.
  • CATPart Path column with a file browser, for the part that physically represents the tool or assembly.
  • Families whose keyword lists may be incomplete are flagged in the window with a warning — use Add Column to fill the gaps.

Notes

  • Build runs a generated macro. Calling CreateCatalogFromcsv over COM from Python produces a catalog rooted at an empty Chapter.1 with the real tree unreachable inside it, even though CATIA reports success. The identical call made from a CATScript running inside CATIA produces the correct catalog. The script therefore writes a small .CATScript to %TEMP%\catia_macros\ and asks CATIA to run it via SystemService.ExecuteScript. This is a CATIA behaviour, not a pycatia one — it reproduces with raw win32com and with CATIA's own shipped sample CSV.
  • CATPart Path is not written to the catalog CSV. It is not a CATIA keyword, so it is carried in the app's own CSV only. Save reports how many values were left out.
  • Load accepts catalogs saved by earlier runs, including files written before the Keywords / Types row labels were added.
  • Settings (last CSV, last folders) are stored in %APPDATA%\pycatia_scripts\Manage_Tooling_Catalog\.

Home


Getting Started


Contributing


Any Document Scripts


Drawing Document Scripts


Part Document Scripts


Shape Generation Scripts


Process Document Scripts


Product Document Scripts


Utility Scripts


Legal

Clone this wiki locally