0

I am new to opencad, I got a task to draw hundreds of dash lines, each dash line is contracuted with two points, and the values of the points are saved in an excel file like this:

1075    7755
1075    7541
1075    7340
1075    7114
1075    6936
1075    6738

Each row represents a point, and two ajacent points construct a line, I have a lot of such values, how should I acheive drawing the lines. Thank you very much for your help.

Tom
  • 385
  • 3
  • 7
  • 17

1 Answers1

0

Late answer, but what the hell. You don't (didn't) need AutoLISP to do it, a script would do. I'd start with using Excel to create the commands, adding a third column with a function:

=concat("LINE ",A1," ",B1)

Just in case - you put this into the topmost cell, and then drag the little square dot down the column so it fills it in entirely, adjusting row references. Once it's done, select the column again, copy and paste the values into a simple text editor like Notepad. It should look like:

LINE 1075 7755
LINE 1075 7541
LINE 1075 7340
LINE 1075 7114
LINE 1075 6936
LINE 1075 6738

Now save it as a .scr file (f.i. dashedlines.scr). In AutoCAD, type "script", and in the dialog box find the file you just created. It should draw the lines in no time.

AutoLISP or VB app would fit if you needed more integration, say automatic redrawing when Excel data change.

ptrk
  • 1,800
  • 1
  • 15
  • 24