Skip to content

Screenshot White Background

KaiUR edited this page May 21, 2026 · 2 revisions

Screenshot White Background

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


Description

Captures a screenshot of the active 3D viewer with a white background. The spec tree is hidden for the capture and the original background colour is restored immediately after. Output path, width, and height are configured via a dialog before capturing.


Requirements

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

Usage

  1. Open any CATIA document with a 3D view
  2. Orient the model as desired
  3. Run the script
  4. The dialog appears — set output path, width, and height
  5. Click OK — the image is captured and the original background is restored

Dialog Options

Field Description
Output file Full path for the output PNG file
Width (px) Image width in pixels
Height (px) Image height in pixels

Output

A PNG image at the specified path with a white background and no spec tree visible.


Notes

  • The spec tree is temporarily hidden during capture and restored afterwards
  • The viewer background colour is temporarily set to white (RGB 255,255,255) and restored afterwards
  • If any error occurs during capture, the original background and spec tree state are still restored
  • Only the active (front) viewer window 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