Skip to content

Check Missing Files

KaiUR edited this page May 21, 2026 · 4 revisions

Check Missing Files

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


Description

Recursively traverses the active CATProduct assembly tree and checks whether the file referenced by each component instance actually exists on disk. Components whose files cannot be found are listed with their full assembly path and last known file location. A CSV is saved only if missing or unresolved references are found.


Requirements

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

Usage

  1. Open a CATProduct in CATIA
  2. Run the script
  3. Results are printed to the console
  4. If missing or unresolved references are found, a CSV is also saved next to the CATProduct

Console Output

 Checked 12 component reference(s)

  Instance                            Status       File
  ----------------------------------- ------------ --------------------------------------------------
  Bracket_L                           MISSING      D:\Parts\Bracket_L.CATPart
  Seal_Ring                           UNRESOLVED   Seal_Ring.CATPart

 Summary: 10 OK  |  1 Missing  |  1 Unresolved

Status Definitions

Status Meaning
OK File path is known and the file exists on disk
MISSING Full path is available but the file does not exist at that location
UNRESOLVED Only the file name (no path) is available; existence cannot be checked

Output (when problems found)

CSV file: <ProductName>_MissingFiles.csv

Column Content
Assembly Path Full path through the assembly tree
Instance Name Component instance name
File Reference Last known file path or name
Status MISSING or UNRESOLVED

Notes

  • OK components are not written to the CSV — only MISSING and UNRESOLVED entries
  • If all references are resolved, no CSV is created and a confirmation message is printed
  • UNRESOLVED typically means the product was opened without resolving all links, or the component was never saved

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