Skip to content

Batch Rename Instances

KaiUR edited this page May 22, 2026 · 4 revisions

Batch Rename Instances

File: Product_Document_Scripts/Batch_Rename_Instances.py
Version: 1.1
Document Type: Product


Description

Renames all direct child instances of the active CATProduct using a configurable prefix, start number, step increment, zero-padding width, and optional suffix. A preview of the old-to-new name mapping is shown before any changes are applied. Sort order (current, alphabetical, or reverse alphabetical) is selectable. Only first-level instances are renamed — sub-assemblies below are not affected.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Required
Open document Product

Usage

  1. Open a CATProduct in CATIA
  2. Run the script
  3. The rename dialog appears — configure the naming parameters
  4. Click Preview to see the old → new name mapping
  5. Click OK to apply, or Cancel to exit without changes

Dialog Options

Field Description Default
Prefix Text prepended to each number Part
Start number First number in the sequence 1
Step Increment between numbers 1
Zero-pad width Minimum digit width (zero-padded) 3
Suffix Text appended after each number (blank)
Sort order Order in which instances are numbered Current order

Example: Prefix=Rib, Start=10, Step=10, Pad=3, Suffix=_LRib010_L, Rib020_L, Rib030_L


Notes

  • Only the first level of the assembly tree is renamed; sub-assemblies and their children are not touched
  • The preview updates when Preview is clicked; changes are not applied until OK is confirmed
  • Instance renames are reflected in the CATIA specification tree immediately
  • Part numbers and reference product names are not changed — only the instance name

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