Skip to content

Export Holes To CSV

KaiUR edited this page May 22, 2026 · 4 revisions

Export Holes To CSV

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


Description

Searches the active CATPart for all Hole features using the CATIA internal search (CATPrtSearch.Hole,all), then exports their properties and spatial positions to a CSV file. Position is the anchor point of the hole on the entry face, read via the pycatia Hole.get_origin() method.


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 derived from CatHoleType enum (e.g. Simple, Counterbored, Countersunk, Counterdrilled, Tapered)
Diameter_mm Nominal diameter
Depth_mm Depth value, or Through for through holes
Thread Thread description if threaded, else blank
Origin_X_mm X coordinate of the hole anchor point on the entry face
Origin_Y_mm Y coordinate
Origin_Z_mm Z coordinate

Notes

  • Position is the hole anchor point on the entry face (from Hole.get_origin()), not the volume centre of gravity
  • Depth is read from Hole.bottom_limit.dimension; through holes (catTrimmedHoleBottom) are written as Through
  • Thread description is read from hole.hole_thread_description; blank if not threaded
  • Holes inside suppressed bodies may not be found by the search
  • No SPA licence is required — position is read directly from the hole geometry

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