Importing a batch of xy coordinates?

Use this forum to ask questions about how to do things in QCAD 2.1/2.2.

Moderator: andrew

Locked
shawner
Registered Member
Posts: 2
Joined: Sat Sep 13, 2008 3:30 am
Location: Volcano, Hawaii

Importing a batch of xy coordinates?

Post by shawner » Sat Sep 13, 2008 3:45 am

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-

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Post by andrew » Sat Sep 13, 2008 10:24 am

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:

Code: Select all

0
POINT
10
[X-coordinate of point]
20
[Y-coordinate of point]
For example for two points at (50.0,150.0) and (12.5,25.4), your text file 'example.dxf' would look like this:

Code: Select all

0
POINT
10
50.0
20
150.0
0
POINT
10
12.5
20
25.4

shawner
Registered Member
Posts: 2
Joined: Sat Sep 13, 2008 3:30 am
Location: Volcano, Hawaii

Should of mentioned I'm on OS X 10.5

Post by shawner » Sat Sep 13, 2008 10:42 am

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.

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Should of mentioned I'm on OS X 10.5

Post by andrew » Sat Sep 13, 2008 10:48 am

shawner wrote:I'm assuming Word can. I'll give it a try.
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.

Rdack
Registered Member
Posts: 1
Joined: Sun Mar 08, 2015 8:38 pm

Re: Importing a batch of xy coordinates?

Post by Rdack » Sun Mar 08, 2015 8:40 pm

Although one can quickly write a macro in emacs to do this, it seems really unneccsary. The program should just handle CSV

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Importing a batch of xy coordinates?

Post by andrew » Mon Mar 09, 2015 9:00 am

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

Locked

Return to “QCAD 2.1/2.2 'How Do I' Questions”