Export X,Y,Z position of group of points

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
nacho
Newbie Member
Posts: 7
Joined: Tue Mar 10, 2020 10:48 pm

Export X,Y,Z position of group of points

Post by nacho » Mon Mar 06, 2023 4:00 am

Hello

It is possible to export X,Y,Z position of a group of points to CSV or into command line window?

Misc > Information > Store positions will provide X and Y but no Z

looking for a "Store positions-3D" or a script


Thanks!

PS: I'm using QCad Version: 3.27.1.0 (3.27.1) Linux x86_64

CVH
Premier Member
Posts: 3477
Joined: Wed Sep 27, 2017 4:17 pm

Re: Export X,Y,Z position of group of points

Post by CVH » Mon Mar 06, 2023 6:46 am

nacho,
Yes, that is feasible with a custom script.
Not with the Misc solution because that is intended to re-use the output as coordinates and QCAD is basically 2D.

And yes, if you can select those entities because I read some complaints about not being able to select 3D entities.

These questions fall in the same category as this one:
https://www.qcad.org/rsforum/viewtopic. ... 117#p40117
But I didn't get a callback yet.

There are two examples scripts by me on the forum:
https://www.qcad.org/rsforum/viewtopic.php?f=30&t=7497
https://www.qcad.org/rsforum/viewtopic.php?f=30&t=7544
Besides these I have a large collection of CSV tools and wrote the addon DrawFromCSV what can import CSV style drawing commands.

It might require some scripting skills to modify the examples to your needs.
I could help with that but then I need an example drawing of the input, what to query and what and how to export.

Another option is the the command line tool dwg2csv:
https://www.ribbonsoft.com/en/products/ ... line-tools
I only find it hard to configure and to execute it on Windows, here is a usage example:
https://www.qcad.org/rsforum/viewtopic. ... csv#p33031

Regards,
CVH

nacho
Newbie Member
Posts: 7
Joined: Tue Mar 10, 2020 10:48 pm

Re: Export X,Y,Z position of group of points

Post by nacho » Mon Mar 06, 2023 10:53 am

Hello CVH

I saw the post you mentioned, but cant figure how to solve, as I know nothing about scripts.

Attached a simple dxf with 4 points, all of them has a Z coordinate. I'm looking to get a CSV output (to file or to QCAD command line):

Code: Select all

30,190,120
120,190.5,70
104.5,15,-25
11,11.85,44
Attachments
four_3d_points_to_export.dxf
(103.4 KiB) Downloaded 172 times

CVH
Premier Member
Posts: 3477
Joined: Wed Sep 27, 2017 4:17 pm

Re: Export X,Y,Z position of group of points

Post by CVH » Mon Mar 06, 2023 4:59 pm

nacho,

This OS command line instruction should do the trick.

Code: Select all

dwg2csv -f -t Point -p Type -p Position:X -p Position:Y -p Position:Z four_3d_points_to_export.dxf
But if you want a GUI based custom script then please contact me per PM (Private message).
The easiest way is by clicking on my profile name.

Regards,
CVH

nacho
Newbie Member
Posts: 7
Joined: Tue Mar 10, 2020 10:48 pm

Re: Export X,Y,Z position of group of points

Post by nacho » Mon Mar 06, 2023 7:50 pm

dwg2csv -f -t Point -p Type -p Position:X -p Position:Y -p Position:Z four_3d_points_to_export.dxf
That was the solution.

Million 3D thanks!

CVH
Premier Member
Posts: 3477
Joined: Wed Sep 27, 2017 4:17 pm

Re: Export X,Y,Z position of group of points

Post by CVH » Mon Mar 06, 2023 9:55 pm

nacho wrote:
Mon Mar 06, 2023 7:50 pm
That was the solution.
Good for you :P but I can't get it running here... Windows.

It has to do with the UAC, protected disk area, Slash vs Back Slash and so on... :cry:
I think I'd better stick with my collection of CSV tools. :wink:
All if the ongoing porting to Qt6 doesn't get in the way.

When considered as solved, please prefix the title of your first post with [Solved] by editing it.

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”