draw polyline from excel point coordinates

draw polyline from excel point coordinates

Anonymous
Not applicable
22,968 Views
5 Replies
Message 1 of 6

draw polyline from excel point coordinates

Anonymous
Not applicable

I have an excel sheet with the points  x, y and z coordinate in it. I'd like to draw a polyline using those points. Is there available lisp for this?

Thanks.

0 Likes
Accepted solutions (2)
22,969 Views
5 Replies
Replies (5)
Message 2 of 6

CodeDing
Advisor
Advisor

@Anonymous ,

 

There's probably one somewhere. But we need more information.

 

1) Is the 'Excel file' an .xlsx format? or csv? A csv is easier to manage...

2) Can you post an example of the file? Will it have headers? gaps? any inconsistencies? These are all considered when trying to locate / organize the data from the file.

3) Will it create a 3D polyline (different Z values)? or a 2D polyline (same Z values)? Will this line be closed? or left open?

4) I see you post in the Inventor Customization forum often. Are you familiar enough with VBA? Do you think you would want to use that to accomplish this task?

 

Best,

~DD

0 Likes
Message 3 of 6

alique.langlois
Enthusiast
Enthusiast

Its not really a lisp but would do what your looking for.

 

https://www.cadforum.cz/cadforum_en/how-to-use-xy-coordinates-from-excel-as-polyline-vertices-tip974...

 

Good luck!

Message 4 of 6

Anonymous
Not applicable

Hi @CodeDing .  Please see my answere in blue.

 

1) Is the 'Excel file' an .xlsx format? or csv? A csv is easier to manage...

Csv is also ok for me.

2) Can you post an example of the file? Will it have headers? gaps? any inconsistencies? These are all considered when trying to locate / organize the data from the file.

No gaps, no headers. 

 

 

3) Will it create a 3D polyline (different Z values)? or a 2D polyline (same Z values)? Will this line be closed? or left open?

The Z value will be the different. Open polyline.

 

4) I see you post in the Inventor Customization forum often. Are you familiar enough with VBA? Do you think you would want to use that to accomplish this task?

I have basic knowledge in vba.

This could be also done with Inventor but it doesnt have to be. This is for different part of work where we only use autocad. 

 

Please see attached csv and dwg.

 

Thank you.

 

 

 

 

Please see attached csv and autocad file.

Message 5 of 6

CodeDing
Advisor
Advisor
Accepted solution

@Anonymous ,

 

Easy. Just turn your csv into a script.

 

See this comment here:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/3d-polyline-from-excel-csv-or-txt/m-p/2599462#M284462 

 

Do exactly as they say and your line should draw itself.

- Save x,y,z points as csv (comma delimited)

- open csv in text editor

- Add the text "3DPOLY" as the very first line (do not include quotes)

- Save As the file to a .scr extension instead of csv

- open Acad

- turn your object snaps OFF

- run the script file with the SCRIPT command

 

Your line will draw itself. Piece of cake.

 

Best,

~DD

Message 6 of 6

Sea-Haven
Mentor
Mentor
Accepted solution

Like the others I would just do from excel direct use the concatenate function.

 

screenshot300.png

 

Re CSV as suggested add the 3dpoly as 1st line then Ctrl+A, Ctrl+C then on Autocad command line Ctrl+V saves having to make a script.