Skip to content

Save Child Parts To STL

KaiUR edited this page May 27, 2026 · 3 revisions

Save Child Parts To STL

File: Product_Document_Scripts/Save_Child_Parts_To_STL.py
Version: 1.0
Document Type: CATProduct


Description

Exports all CATParts in an open CATProduct to individual STL files. Files are saved to a subfolder named STL_Export_ProductName alongside the product file. If the product has not been saved, files are exported to a subfolder in the user's Downloads folder.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Not required
Open document CATProduct with child parts

Usage

  1. Open a CATProduct document containing CATParts
  2. Run the script — no user input is required
  3. All CATParts are exported to STL files automatically

Output

STL files are saved to a folder alongside the product file:

ProductFolder\
    STL_Export_MyProduct\
        Part1.stl
        Part2.stl
        Part3.stl

If the product has not been saved to disk yet, files go to:

C:\Users\YourName\Downloads\STL_Export_MyProduct\

If STL files with the same names already exist they will be overwritten.


Notes

  • Each CATPart is opened as a standalone document before export and closed afterward — parts loaded via a product are in visualization mode and produce empty exports if not re-opened this way
  • Focus is returned to the original CATProduct when all exports are complete
  • The product is put into Design Mode and all terminal nodes are activated before the export loop begins
  • The export folder is created automatically if it does not exist

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