Skip to content

Delete Hidden Elements In Geometric Set

KaiUR edited this page Jul 20, 2026 · 1 revision

Delete Hidden Elements In Geometric Set

File: Part_Document_Scripts/Delete_Hidden_Elements_In_Geometric_Set.py
Version: 1.0
Document Type: Part (also works on a part selected inside a Product)


Description

Asks the user to select a geometric set, then scans it recursively for anything hidden and deletes it. Hidden hybrid shapes are collected individually. A hidden child geometric set is collected whole and is not scanned any further, since deleting it removes everything inside it anyway.

A count is shown and confirmation is required before anything is deleted. Useful for clearing construction geometry out of a part before handoff or release.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.10.0
wxPython Required
Open document Part, or a part selected within a Product

Usage

  1. Open a CATPart containing a geometric set
  2. Run the script
  3. Select the geometric set to clean up — click OK when done
  4. The console lists every hidden element found as it scans
  5. Confirm the deletion when prompted — the count of hidden shapes and hidden sets is shown
  6. The part is updated after deletion

Notes

  • A hidden geometric set is deleted whole, including any visible elements inside it. The confirmation dialog says so explicitly whenever hidden sets are part of the deletion. If you want to keep something inside a hidden set, show the set first.
  • Elements with no defined show state are left alone. CATIA reports visibility as a status plus a value; when the status is not catVisPropertyDefined the element is skipped rather than assumed hidden.
  • The scan is recursive through child geometric sets. Visible child sets are descended into; hidden ones are not.
  • The selected set itself is never deleted, only its contents.
  • Visibility can only be read through the selection, so the script briefly selects each element as it scans. The selection is cleared before the deletion is made.
  • Requires pycatia >= 0.10.0 — VisPropertySet.get_show() returns a (status, show) tuple from 0.9.3 onward, and this script relies on that form.
  • To toggle visibility instead of deleting, use Toggle Show Hide Geometric Set.

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