Skip to content

the-tool-store/TableTo3DPoints

Repository files navigation

Repository Details

TableTo3DPointsCLI_cpp - Import Design Points from CSV

A standalone command-line tool that imports named 3D coordinates from a CSV file into an Alibre Design part as design points.

Before You Start

  1. Alibre Design must be installed on your computer.
  2. Alibre Design must be running with at least one file open.
  3. For best results, open the target part file (.AD_PRT) in Alibre Design's editor before running the tool.

Quick Start

Step 1: Open Alibre Design and open your part file (e.g., A.AD_PRT).

Step 2: Open a command prompt (PowerShell or CMD) and run:

TableTo3DPointsCLI_cpp.exe points.csv mm

Step 3: The tool uses the active part automatically. Points appear in the editor. Done!


Usage

TableTo3DPointsCLI_cpp.exe <csv_file> <unit> [--use-params]
TableTo3DPointsCLI_cpp.exe <alibre_file> <csv_file> <unit> [--use-params]

Arguments

Argument Required Description
alibre_file No Path to an Alibre Design part file (.AD_PRT). If omitted, the tool uses the active (topmost) part in Alibre Design.
csv_file Yes Full path to your CSV file containing the point data
unit Yes The unit your CSV coordinates are in: mm, cm, or in
--use-params No Use parameter-based updates instead of delete/recreate
--help, -h, /help, /? No Show help message

Units

Your CSV coordinates are converted to Alibre's internal unit (centimeters):

You type Your CSV values are in What happens
mm Millimeters Values are divided by 10
cm Centimeters Values are used as-is
in Inches Values are multiplied by 2.54

CSV File Format

Your CSV file should have 4 columns: Name, X, Y, Z

Name, X, Y, Z
PT0001, 10, 15, 13
PT0002, 12, 16, 15
PT0003, 14, 17, 17
  • The header row (Name, X, Y, Z) is optional — it is detected and skipped automatically.
  • Spaces around values are trimmed.
  • Rows with fewer than 4 columns or unparseable numbers are skipped with a warning.
  • Empty lines are ignored.

All Argument Combinations

Every valid way to call this tool is listed below. All examples use real paths from the test suite.

Help (works without Alibre installed)

TableTo3DPointsCLI_cpp.exe
TableTo3DPointsCLI_cpp.exe --help
TableTo3DPointsCLI_cpp.exe -h
TableTo3DPointsCLI_cpp.exe /help
TableTo3DPointsCLI_cpp.exe /?
TableTo3DPointsCLI_cpp.exe -?

Active part + millimeters (simplest form)

Uses the topmost (focused) part in Alibre Design. No file path needed.

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" mm

Active part + centimeters

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" cm

Active part + inches

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" in

Active part + millimeters + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" mm --use-params

Active part + centimeters + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" cm --use-params

Active part + inches + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\coordinate_table.csv" in --use-params

Named part + millimeters

Targets a specific part file. Use this when multiple parts are open.

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" mm

Named part + centimeters

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" cm

Named part + inches

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" in

Named part + millimeters + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" mm --use-params

Named part + centimeters + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" cm --use-params

Named part + inches + parameter mode

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\A.AD_PRT" "D:\TableTo3DPoints\coordinate_table.csv" in --use-params

Demo files (50 and 100 points)

TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\demo_050_points.csv" mm
TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\demo_100_points.csv" mm
TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\demo_050_points.csv" mm --use-params
TableTo3DPointsCLI_cpp.exe "D:\TableTo3DPoints\demo_100_points.csv" mm --use-params

Example Output

Per-point status tags

Every point logs what happened to it:

Tag Meaning
[SKIP] Point exists and coordinates are identical — no action taken
[UPDATE] Point exists but coordinates differ — updated
[CREATE] Point is new — created
[FAIL] Error occurred — details shown

All points unchanged (nothing to do)

[1/6] Reading CSV: D:\TableTo3DPoints\coordinate_table.csv
  Loaded 10 point(s), unit = mm (scale factor = 0.1000 to cm)
  Mode: delete/recreate (default, resets parametric links on update)
[2/6] Connecting to Alibre Design...
  Alibre Design is running. Attached to the active instance.
[3/6] Using the active part in Alibre Design...
  Using active part: A
  File: D:/Table_to_3DPoints/Table_to_3DPoints_V03-AD21/A.AD_PRT
  Session: A
[4/6] Scanning existing design points...
  Found 51 existing design point(s) in the part
  [SKIP] PT0001  (1.0000, 1.5000, 1.3000) unchanged
  [SKIP] PT0002  (1.2000, 1.6000, 1.5000) unchanged
  [SKIP] PT0003  (1.4000, 1.7000, 1.7000) unchanged
  ...
  Plan: 0 to update, 0 to create, 10 unchanged (skipped)
[5/6] No changes needed - all points are up to date.
[6/6] Saving file (leaving it open in Alibre Design)...

DONE  0 created, 0 updated, 10 unchanged, 0 error(s)
      Design points: 51 before -> 51 after

Updating points with changed coordinates

[4/6] Scanning existing design points...
  Found 51 existing design point(s) in the part
  Plan: 10 to update, 0 to create, 0 unchanged (skipped)
[5/6] Applying changes to design...
  Updating 10 existing point(s)...
  [UPDATE] PT0001  (10.0000, 15.0000, 13.0000)
  [UPDATE] PT0002  (12.0000, 16.0000, 15.0000)
  ...

DONE  0 created, 10 updated, 0 unchanged, 0 error(s)

First run — creating new points

[4/6] Scanning existing design points...
  Found 1 existing design point(s) in the part
  Plan: 0 to update, 10 to create, 0 unchanged (skipped)
[5/6] Applying changes to design...
  Creating 10 new point(s)...
  [CREATE] PT0001  (1.0000, 1.5000, 1.3000)
  [CREATE] PT0002  (1.2000, 1.6000, 1.5000)
  ...

DONE  10 created, 0 updated, 0 unchanged, 0 error(s)
      Design points: 1 before -> 11 after

Mixed — some new, some changed, some unchanged

[4/6] Scanning existing design points...
  Found 51 existing design point(s) in the part
  [SKIP] PT0001  (1.0000, 1.5000, 1.3000) unchanged
  [SKIP] PT0002  (1.2000, 1.6000, 1.5000) unchanged
  ...
  Plan: 5 to update, 3 to create, 42 unchanged (skipped)
[5/6] Applying changes to design...
  Updating 5 existing point(s)...
  [UPDATE] PT0043  (5.0000, 10.0000, 15.0000)
  ...
  Creating 3 new point(s)...
  [CREATE] PT0051  (8.0000, 12.0000, 6.0000)
  ...

DONE  3 created, 5 updated, 42 unchanged, 0 error(s)
      Design points: 51 before -> 54 after

How It Works

  1. Reads your CSV and parses the Name, X, Y, Z columns.
  2. Connects to Alibre Design — attaches to the running instance via COM automation.
  3. Opens the part file:
    • If no file specified: uses the topmost (active) session in Alibre — the part you're currently looking at.
    • If file specified and already open in Alibre: uses that session directly.
    • If file specified but not open: opens it in the background without an editor window.
  4. Displays the part name and file path so you can confirm the right part is being used.
  5. Scans existing design points and reads their current X, Y, Z coordinates.
  6. Compares each CSV row against the existing point with the same name (case-insensitive):
    • Coordinates match[SKIP] — no action, no COM calls, no performance cost.
    • Coordinates differ → queued for [UPDATE].
    • Name not found → queued for [CREATE].
  7. Applies only the necessary changes — unchanged points are never touched.
  8. Saves the file. If the part was already open in Alibre, it stays open. Otherwise it is saved and closed.

Multiple parts open?

Scenario What happens
No file arg, multiple parts open Uses the topmost/focused part — the one you're actively looking at
File arg matches an open part Uses that specific part (matched by file path)
File arg doesn't match any open part Opens it in the background

Change Detection

The tool compares CSV coordinates (after unit conversion) against existing design point coordinates. Only points with actual changes are modified — unchanged points are skipped entirely with zero COM overhead.

CSV row Name exists? Coordinates match? Action
PT0001, 10, 15, 13 Yes Yes [SKIP] — nothing touched
PT0001, 10, 15, 20 Yes No (Z changed) [UPDATE] — coordinates updated
PT0099, 5, 5, 5 No n/a [CREATE] — new point
(not in CSV) Yes n/a Left untouched — never deleted

This means running the tool repeatedly with the same CSV is essentially free — it detects nothing changed and skips everything.

Default mode vs. --use-params

When a point does need updating:

Mode What happens on update Parametric links
Default (no flag) Point is deleted and recreated at the new position Links are reset
--use-params Point's X/Y/Z parameter values are changed in place Links are preserved

Use --use-params when other features reference the point's parameters (equations, constraints, etc.).


Aborting

If you're importing many points and need to stop:

  1. Press Ctrl+C.
  2. The current point finishes, then the tool stops.
  3. All completed points are saved — no work is lost.
  4. Run again with the same CSV to continue. Points already created/updated will be detected as unchanged ([SKIP]), and only the remaining points will be processed.

Troubleshooting

"Could not connect to Alibre Design"

Alibre Design is not running or has no files open.

Fix:

  1. Launch Alibre Design
  2. Open the target part file (or any file)
  3. Run this tool again

"No active part found in Alibre Design"

You ran the tool without specifying a file, and Alibre has no active session.

Fix: Open a part file in Alibre Design, or specify the file path explicitly:

TableTo3DPointsCLI_cpp.exe C:\Parts\MyPart.AD_PRT points.csv mm

"Failed to open file"

The file path may be wrong, the file may be corrupted, or it may not be an Alibre part file.

Fix: Check that the file path is correct and that the file is a valid .AD_PRT file. Try opening it in Alibre Design manually first.

"The file is not a design part"

You specified an assembly (.AD_ASM) or drawing (.AD_DRW) file.

Fix: This tool only works with part files (.AD_PRT).

Points don't appear in the editor

After the tool runs, the design points should appear in Alibre Design's feature tree.

Fix:

  1. Press F5 to regenerate the design.
  2. If that doesn't help, close and reopen the file.

"No valid point rows found in CSV"

Your CSV doesn't have valid data rows.

Fix: Each row needs at least 4 comma-separated values: a name and three numbers. Example: PT0001, 10, 15, 13

Known Issues

  • Create points on a clean part when possible

Contribution

Contributions to the codebase are not currently accepted, but questions and comments are welcome.

Additional Resources

NA

Acknowledgment and License

MIT — see LICENSE.

Credit & Citation

Alibre Forum - Inspiration

System CPP Version

About

A standalone command-line tool that imports named 3D coordinates from a CSV file into an Alibre Design part as design points.

Resources

License

Stars

Watchers

Forks