Skip to content

Screenshot White Background

KaiUR edited this page May 22, 2026 · 4 revisions

Screenshot White Background

File: Any_Document_Scripts/Screenshot_White_Background.py
Version: 1.1
Document Type: Any (Part, Product, or Drawing)


Description

Captures a screenshot of the active viewer with a white background. The spec tree is hidden for the capture and the original background colour is restored immediately after. Output path and format are configured via a dialog before capturing. The image is captured at the current viewer resolution — CATIA's CaptureToFile API does not support specifying output dimensions.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Required
Open document Any with a viewer

Usage

  1. Open any CATIA document
  2. Orient the model as desired
  3. Run the script
  4. The dialog appears — set the output file path and choose a supported format via the extension
  5. Click OK — the image is captured and the original background is restored

Dialog Options

Field Description
Output file Full path for the output image; extension determines format (.bmp, .jpg, .tif)

Use the Browse… button to pick a location and format from the file dialog.


Supported Formats

Extension Format
.bmp BMP (catCaptureFormatBMP)
.jpg / .jpeg JPEG (catCaptureFormatJPEG)
.tif / .tiff TIFF (catCaptureFormatTIFF)

PNG is not supported by the CATIA CatCaptureFormat API.


Output

An image at the specified path with a white background and no spec tree visible. Resolution matches the current viewer window size.


Notes

  • The spec tree is temporarily hidden during capture and restored afterwards
  • The viewer background colour is temporarily set to white (1.0, 1.0, 1.0 in 0–1 float range) and restored afterwards
  • If any error occurs during capture, the original background and spec tree state are still restored
  • Only the active viewer is captured

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