Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

draw polyline from excel point coordinates

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
16152 Views, 5 Replies

draw polyline from excel point coordinates

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.

5 REPLIES 5
Message 2 of 6
CodeDing
in reply to: Anonymous

@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


Need AutoLisp help? Try my custom GPT 'AutoLISP Ace':
https://chat.openai.com/g/g-Zt0xFNpOH-autolisp-ace
Message 3 of 6
alique.langlois
in reply to: Anonymous

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
in reply to: CodeDing

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
in reply to: Anonymous

@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


Need AutoLisp help? Try my custom GPT 'AutoLISP Ace':
https://chat.openai.com/g/g-Zt0xFNpOH-autolisp-ace
Message 6 of 6
Sea-Haven
in reply to: Anonymous

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta