Skip to content

Navigation Menu

Sign in
Sign up

Create Spline From Coordinates

KaiUR edited this page May 22, 2026 · 1 revision

Create Spline From Coordinates

File: Part_Document_Scripts/Create_Spline_From_Coordinates.py
Version: 1.0
Document Type: Part


Description

Creates a GSD point set and spline in the active CATPart from arbitrary X Y (or X Y Z) coordinates. Coordinates can be loaded from a .dat, .csv, or .txt file, or pasted directly into a text area in the dialog. Non-numeric header lines and lines beginning with # are silently skipped.

The script creates a geometric set (user-named) containing:

  • A Points sub-set with all input points
  • A GSD spline (Spline) through all points — open or closed at the user's option

A uniform scale factor can be applied to convert between coordinate units. Settings are persisted between runs.


Requirements

Requirement Value
Python >= 3.10
pycatia >= 0.8.3
wxPython Required
Open document Part

Usage

  1. Open a CATPart document
  2. Run the script
  3. Choose input mode (File or Paste Text) and supply your coordinates
  4. Set the geometric set name, scale factor, close option, and output plane
  5. Click OK — a progress bar shows while geometry is created
  6. A new geometric set is added to the part containing the point set and spline

Input Formats

File (.dat / .csv / .txt)

Click Browse to select a coordinate file. Supported formats:

Format Description
Selig .dat First line is a text label (skipped), followed by X Y pairs
CSV Comma-separated X,Y or X,Y,Z values, optional header row
Whitespace Space- or tab-separated X Y or X Y Z values

Lines beginning with # are treated as comments and skipped. Any line that cannot be parsed as numbers is silently ignored, so header rows require no special handling.

Paste Text

Switch to Paste Text mode and type or paste coordinates directly into the text area. Each line should contain one point:

10.5 0.0
20.3 5.2
35.0 8.1

Columns may be separated by spaces, tabs, or commas.


Parameters

Parameter Description Default
Input mode File or Paste Text File
Geometric set name Name given to the output geometric set Spline
Scale factor Uniform multiplier applied to all coordinates 1.0
Close spline Connect the last point back to the first Unchecked
Plane Output plane for 2-D input: XY, XZ, or YZ XY

Scale Factor

A uniform multiplier applied to all coordinate values:

Value Effect
1.0 Use raw values as-is (coordinates already in mm)
1000.0 Convert metres → millimetres
25.4 Convert inches → millimetres
0 Same as 1.0 — no scaling

Close Spline

Connects the last point back to the first point to form a closed loop.

  • Enable for closed profiles (airfoil cross-sections, pipe profiles, cam lobes)
  • Disable for open curves (path guides, camber lines, boundary curves)

Plane (2-D input only)

Determines which 3-D plane the 2-D (X Y) input is placed on:

Plane Point mapping
XY (X, Y, 0)
XZ (X, 0, Y)
YZ (0, X, Y)

If 3-column (X Y Z) input is supplied, this setting is ignored.


Dialog Buttons

Button Action
OK Validates inputs and creates the spline
Cancel Exits without creating anything
Reset Defaults Restores factory default values
Clear Saved Deletes the saved user presets file
Help Opens the full in-script user manual

Output

A geometric set named as specified is created at the top level of the part tree:

<Geometric Set Name>
├── Points
│ ├── Point_001
│ ├── Point_002
│ │ ...
│ └── Point_NNN
└── Spline (open or closed)

Settings Persistence

All settings except the raw coordinate data are saved automatically to:

%APPDATA%\pycatia_scripts\Create_Spline_From_Coordinates\user_presets.json

The next time the script runs, your last-used values are pre-filled in the dialog.


Notes

  • At least 3 valid coordinate pairs are required to create a spline
  • If 3-D (X Y Z) coordinates are detected in any row, the plane selection is ignored for all rows
  • The geometric set can be renamed in the CATIA tree after generation

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

AltStyle によって変換されたページ (->オリジナル) /