-
Notifications
You must be signed in to change notification settings - Fork 0
Create Spline From Coordinates
File: Part_Document_Scripts/Create_Spline_From_Coordinates.py
Version: 1.0
Document Type: Part
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.
| Requirement | Value |
|---|---|
| Python | >= 3.10 |
| pycatia | >= 0.8.3 |
| wxPython | Required |
| Open document | Part |
- Open a CATPart document
- Run the script
- Choose input mode (File or Paste Text) and supply your coordinates
- Set the geometric set name, scale factor, close option, and output plane
- Click OK — a progress bar shows while geometry is created
- A new geometric set is added to the part containing the point set and spline
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.
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.
| 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 |
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 |
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)
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.
| 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 |
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)
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.
- 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
Getting Started
Contributing
- Copy Name and Colour
- Export Properties To CSV
- Find And Select By Name
- Hide Planes And Axis Systems
- Rename Hybrid Shapes
- Replace Name Hybrid Shapes
- Reset Visual Properties
- Screenshot White Background
- Swap Names
- Toggle Show Hide Geometric Set
- Add Border And Title Block
- Add Border And Title Block With Values
- Batch CATDrawing To DXF
- Batch CATDrawing To PDF
- Create Drawing Border And Title Block
- Create Drawing Border And Title Block With Values
- Export Drawing Dimensions To CSV
- Update All Drawing Views
- Update Title Block From Properties
- Update Title Block Headings
- Axis To Axis Keep History
- Axis To Axis Keep History And Structure
- Axis To Axis Keep Name
- Axis To Axis Keep Name And Structure
- Batch Isolate Geometric Set
- Check Duplicate Names In Geometric Set
- Check Open Bodies
- Colour Code By Geometric Set
- Copy Geometric Set To New Part
- Copy Parameters Between Parts
- Create Construction Planes
- Create Spline From Coordinates
- Create ISM OSM STEP Files
- Delete Deactivated Features
- Delete Hidden Elements In Geometric Set
- Export 3D Annotations To CSV
- Export All Parameters To CSV
- Export Curve Lengths Surface Areas To CSV
- Export Geometric Set Structure To CSV
- Export Holes To CSV
- Export Mass CoG Inertia To CSV
- Export Parameter Dependencies To CSV
- Export Points Axis and Geo Set To CSV
- Export Points Axis and Geo Set To XYZ
- Export Points Geo Set To CSV
- Export Points Geo Set To XYZ
- Export Sketch Constraints To CSV
- Extract Boundary Curves
- IGES Export Curve Axis
- Insert Points Catia
- Insert Points Catia Keep History
- Insert Points Catia With Names
- Insert Points Catia With Names Keep History
- Join Explicit No Connect
- Join Explicit No Connect Curve
- Join Explicit No Connect Surface
- List Properties To CSV
- Match Properties In Geometric Set
- Measure Curve With 3 Points As Circle
- Measure Curve With 3 Points As Circle Keep Con
- Measure Radius Surface
- Measure Radius Surface Keep Con
- Measure Radius Surface Keep Con Auto Edge
- Mirror Keep History
- Mirror Keep History And Structure
- Mirror Keep Name
- Mirror Keep Name And Structure
- Publish Hybrid Shapes In Geometric Set
- Reorder Geometric Set Alphabetically
- Rotate Angle Keep History
- Rotate Angle Keep History And Structure
- Rotate Angle Keep Name
- Rotate Angle Keep Name And Structure
- Rotate Three Points Keep History
- Rotate Three Points Keep History And Structure
- Rotate Three Points Keep Name
- Rotate Three Points Keep Name And Structure
- Scale Keep History
- Scale Keep History And Structure
- Scale Keep Name
- Scale Keep Name And Structure
- Select By Colour
- Spline Through Points In Geometric Set
- Translate Direction Distance Keep History
- Translate Direction Distance Keep History And Structure
- Translate Direction Distance Keep Name
- Translate Direction Distance Keep Name And Structure
- Custom Coordinate Airfoil Generator
- Ellipse Generator
- Hole Size Test Plate Generator
- Involute Gear Generator
- NACA 4 Digit Airfoil Generator
- NACA 5 Digit Airfoil Generator
- Plot 2D Function
- Plot 3D Parametric Curve
- Regular Polygon Generator
- Sine Wave Curve Generator
- Spring Generator
- Check Operation Parameters Against Limits
- Export NC Program Names To CSV
- Export Process Table Parameters
- Export Resource List
- Export Tool List From Process
- Manage Program Names And Comments
- Manage Tooling Catalog
- Rename Operations From Tool Name
- Batch Instance Name Equal Part Number
- Batch Rename Instances
- BOM Export To CSV
- BOM Export With Materials
- Check Missing Files
- Clash Detection Export
- Export Assembly As STEP
- Export Component Positions To CSV
- Save Child Parts To STEP
- Save Child Parts To STL
- Backup CATIA Settings
- Clear Script Settings
- Clear CATIA Temp Files
- Configure CATIA Version Settings
- Kill CATIA Processes
- Open CATIA Settings Folder
- Reset CATIA Settings
- Restore CATIA Settings
- Set CATIA Environment Variable
- Toggle CATIA No Start Document
Legal