Using "p2csv" lisp to exports selected AutoCAD points to a CSV file with user-defined options

Using "p2csv" lisp to exports selected AutoCAD points to a CSV file with user-defined options

mohamedhnfy
Community Visitor Community Visitor
554 Views
1 Reply
Message 1 of 2

Using "p2csv" lisp to exports selected AutoCAD points to a CSV file with user-defined options

mohamedhnfy
Community Visitor
Community Visitor

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.

0 Likes
555 Views
1 Reply
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor

It may be worthwhile providing a sample dwg with the "selected AutoCAD points" clearly shown, the task is not a hard one. Really need to know what is a "Point".

0 Likes