Skip to content

Select By Colour

KaiUR edited this page Jul 20, 2026 · 4 revisions

Select By Colour

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


Description

Selects all hybrid shapes within a geometric set whose real colour exactly matches the colour of a chosen source element. Shapes with undefined colours are skipped. The matching shapes are left selected in CATIA at the end of the script so they can be immediately acted on.

Pairs naturally with Copy Name and Colour and Colour Code By Geometric Set as a "find what I already coloured" tool.


Requirements

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

Usage

  1. Open a CATPart document containing a geometric set
  2. Run the script
  3. A CATIA selection prompt appears — select the geometric set to search within
  4. A second prompt appears — click the source element whose colour to match
  5. All matching shapes are selected in CATIA; the count is printed to the console

Notes

  • Matching is exact — all three RGB components must be identical
  • Elements whose real colour status is catVisPropertyUnDefined are skipped
  • Shapes that display an inherited colour but have a different real colour will not match — the comparison uses the real (stored) colour, not the displayed colour
  • If no matches are found the selection is cleared and a message is printed

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