Skip to content

Batch Instance Name Equal Part Number

KaiUR edited this page May 21, 2026 · 3 revisions

Batch Instance Name Equal Part Number

File: Product_Document_Scripts/Batch_Instance_Name_Equal_Part_Number.py
Version: 1.0
Document Type: Product


Description

Recurses through the full active CATProduct tree and sets every component's instance name (the name shown in the spec tree) to match its part number. Components with an empty part number are skipped and reported. One of the most commonly needed assembly cleanup operations in CATIA V5.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Not required
Open document CATProduct

Usage

  1. Open a CATProduct document
  2. Run the script
  3. All instance names in the tree are updated automatically

Output

Console output lists every rename and every skipped component. A summary shows the total number of instances renamed.


Notes

  • Components with no part number set are skipped and listed at the end
  • The script recurses into all sub-assemblies
  • The product is not saved automatically after renaming — save manually if required

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