Skip to content

Export Holes To CSV

KaiUR edited this page May 21, 2026 · 4 revisions

Export Holes To CSV

File: Part_Document_Scripts/Export_Holes_To_CSV.py
Version: 1.0
Document Type: Part


Description

Searches the active CATPart for all Hole features using the CATIA internal search, then exports their properties and spatial positions to a CSV file. Position is determined using the SPA (Space Analysis) centre of gravity of each hole volume.


Requirements

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

Usage

  1. Open a CATPart containing hole features
  2. Run the script
  3. The CSV is saved next to the CATPart file (or to ~/Downloads if unsaved)

Output

CSV file: <PartName>_Holes.csv

Column Content
Name Hole feature name
Body Parent body name
Type Hole type (Simple, Tapered, Counterbored, Countersunk, Counterdrilled)
Diameter_mm Nominal diameter
Depth_mm Depth value (blank for through holes)
Thread Thread description if threaded, else blank
CoG_X_mm X position of hole volume centre of gravity
CoG_Y_mm Y position
CoG_Z_mm Z position

Notes

  • Position is the centre of gravity of the hole volume, not the entry face centroid
  • Thread description is read from the hole's ThreadDescription property; blank if the hole is not threaded
  • Holes inside suppressed bodies may not be found by the search
  • The script uses the SPA workbench for position; this requires the part to be up to date

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