[solved] polyline multiple points from command line

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

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
ov10fac
Active Member
Posts: 44
Joined: Thu Jan 29, 2009 3:25 pm
Location: Omaha Nebraska

[solved] polyline multiple points from command line

Post by ov10fac » Sun Jul 09, 2017 4:20 pm

I have a poly line that consists of about 30 sets of points. I see how to enter them one at a time to draw my line, but is there any way to enter all 30 at the same time? Something link 1,0;2,5;3,5 etc. So I would enter the start point, then some form of separator, the second point, a separator third etc.

I know it can be done in a script using an ascii text file, but for my purposes simply entering them on the command line is quicker and easire right now.

Thanks.

ov10fac
Active Member
Posts: 44
Joined: Thu Jan 29, 2009 3:25 pm
Location: Omaha Nebraska

Re: polyline multiple points from command line

Post by ov10fac » Sun Jul 09, 2017 4:25 pm

Correction, not a polyline, but the spline tool. Sorry about that.

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

Re: polyline multiple points from command line

Post by andrew » Mon Jul 10, 2017 9:16 am

First, get the coordinates into the following format (for example through a CSV export from a spreadsheet or in a simple plain text file):

x1,y1
x2,y2
x3,y3
...

For example:

0,0
40.5,25.3
50,75
...

Copy the whole list of these coordinates to the clipboard (select the multiple lines from the plain text or CSV file and copy to clipboard in a text editor).

Then, start the tool for which you want to use the coordinates. This can be any tool that expects one or multiple coordinates such as the polyline tool, spline tool, point tool, circle with radius tool, etc.

Click into the command line input field or press the spacebar to make sure the command line has the keyboard focus.
Paste the list of coordinates into the command line input field using Ctrl-V (or Cmd-V on macOS).

QCAD now enters the list of coordinates just as if you would have entered them one by one manually.

If the above example does not work, please check your configured coordinate format under Edit > Application Preferences > General > Coordinate Format.

ov10fac
Active Member
Posts: 44
Joined: Thu Jan 29, 2009 3:25 pm
Location: Omaha Nebraska

Re: polyline multiple points from command line

Post by ov10fac » Mon Jul 10, 2017 1:36 pm

Andrew,
Thank you. I tried your directions with a spline. When I select spline and "fit points" the command line shows "First Control Point:". When I past the coordinates into the command line, it only accepts the first set. The others show up in the command line history as "coordinates" but the command line shows "Next Control Point:". So it seems to know that I am entering coordinates, but the spline tool doesn't seem to want to accept more than one point at a time.

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

Re: polyline multiple points from command line

Post by andrew » Mon Jul 10, 2017 1:38 pm

Please indicate operating system and QCAD version, thanks.

ov10fac
Active Member
Posts: 44
Joined: Thu Jan 29, 2009 3:25 pm
Location: Omaha Nebraska

Re: polyline multiple points from command line

Post by ov10fac » Mon Jul 10, 2017 1:41 pm

Sorry about that. I am using QCAD 3.17.3 running on a Fedora 25 (Linux) platform.

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

Re: polyline multiple points from command line

Post by andrew » Mon Jul 10, 2017 2:22 pm

ov10fac wrote:The others show up in the command line history as "coordinates" but the command line shows "Next Control Point:".
This actually sounds like it worked just fine. Can you please double-check? It's correct that after pasting, the tool remains active (for you to enter, paste or click more coordinates). But if you then right-click to terminate the tool, the spline should be created with the points you have pasted.

ov10fac
Active Member
Posts: 44
Joined: Thu Jan 29, 2009 3:25 pm
Location: Omaha Nebraska

Re: polyline multiple points from command line

Post by ov10fac » Mon Jul 10, 2017 2:46 pm

Yep, you are correct and my bad. I had the degree set to 8 but only entered 4 points. Once I set the degree correctly, everything works like a charm. Many thanks! This will save me a lot of time. I use it to "loft" canoes I am building and the spline makes a great lofting tool.
John

Post Reply

Return to “QCAD 'How Do I' Questions”