Importing a batch of xy coordinates?
Moderator: andrew
Importing a batch of xy coordinates?
Hi- I'm new to CAD and love QCAD so far. I'm designing a kayak, and am trying to use QCAD to 'loft' the form sections; ie, create printable templates. I have a spreadsheet with the cooridinates for each form outline (like this) and would like to be able to import them all at once to plot them, but can't seem to figure out how. Is this possible with QCAD? I've done half of the 18 forms by hand already, but- kind of tedious! Many thanks-
This depends a lot on the tools you have at hand and what tools and commands you are familiar with.
I would probably convert the spreadsheet to CSV (standard plain text table format) and convert that into a simple DXF file (also plain text). This could be relatively easily done using either macros in a powerful text editor (such as 'vim' or 'Emacs') or with command line utilities (such as 'sed').
In any case, if you can get your point data somehow into this plain text format, you can load this with QCAD:
For example for two points at (50.0,150.0) and (12.5,25.4), your text file 'example.dxf' would look like this:
I would probably convert the spreadsheet to CSV (standard plain text table format) and convert that into a simple DXF file (also plain text). This could be relatively easily done using either macros in a powerful text editor (such as 'vim' or 'Emacs') or with command line utilities (such as 'sed').
In any case, if you can get your point data somehow into this plain text format, you can load this with QCAD:
Code: Select all
0
POINT
10
[X-coordinate of point]
20
[Y-coordinate of point]
Code: Select all
0
POINT
10
50.0
20
150.0
0
POINT
10
12.5
20
25.4
Should of mentioned I'm on OS X 10.5
Hmmm. Thanks Andrew- I'll have to snoop around for a Mac text editor that can convert the CSV to a DXF. I'm assuming Word can. I'll give it a try.
Re: Should of mentioned I'm on OS X 10.5
No. I'm talking macro editing here. Of course vim is also available in the Terminal of Mac, but judging from your response I guess you are not familiar with powerful plain text editing tools which probably means you will have to go a manual route.shawner wrote:I'm assuming Word can. I'll give it a try.
Re: Importing a batch of xy coordinates?
Although one can quickly write a macro in emacs to do this, it seems really unneccsary. The program should just handle CSV
Re: Importing a batch of xy coordinates?
Since QCAD 3.7.1, you can use Misc > Import / Export > Import Points to import a list of points in format x,y:
Code: Select all
10.5,20.25
12,30.4
14.2,40