Message 1 of 2
Using "p2csv" lisp to exports selected AutoCAD points to a CSV file with user-defined options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This Lisp function, automates the export process of selected AutoCAD points to a user-specified CSV file. Here's a breakdown of its functionalities:
User Interaction:
- Prompts the user to enter a desired filename for the exported data.
- Offers a default filename ("points_output.csv") if no input is provided and automatically adds the ".csv" extension if missing.
- Allows customization of text height for point labels within the drawing. Offers a default value (0.40) if no input is provided.
- Enables configuration of a point name prefix (e.g., "P") and starting number for the sequence. Defaults to "P" for prefix and 1 for starting number if no input is given.
Functionality:
- Creates a temporary layer named "points_to_CSV" with a yellow color for visual reference of exported points.
- Extracts coordinates (X, Y, Z) for each selected point.
- Generates unique point names based on the defined prefix and starting number.
- Writes point names and their corresponding coordinates to the specified CSV file.
- Places text labels with the generated point names at the corresponding point locations within the drawing.
I hope it helps you.