[solved] "Cropping" .dxf file on command line

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
mylly
Registered Member
Posts: 2
Joined: Thu Dec 07, 2017 3:55 pm

[solved] "Cropping" .dxf file on command line

Post by mylly » Thu Dec 07, 2017 4:08 pm

Hi!

I'm trying to make web app where user uploads his .dxf file to server, and then app finds specific square which limits the object that we need, and converts that area to jpg.
So basically the dxf is very large, and I only need one region from it. I can't convert it to image with full size because it's too large.
I have app that find the square, but now i just need to "crop" the dxf. Is it possible to do using only command line tools?
I'm using qcad-3.19.1-pro-linux-x86_64 version.

Thanks!

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

Re: "Cropping" .dxf file on command line

Post by andrew » Thu Dec 07, 2017 4:35 pm

dwg2bmp should have you covered. To export the rectangle at X,Y with WIDTH / HEIGHT:

Code: Select all

dwg2bmp -w X,Y,WIDTH,HEIGHT -f -o out.png in.dxf
See also:

Code: Select all

dwg2bmp -h

mylly
Registered Member
Posts: 2
Joined: Thu Dec 07, 2017 3:55 pm

Re: "Cropping" .dxf file on command line

Post by mylly » Thu Dec 07, 2017 5:41 pm

Thanks that worked! Feel a bit dummy for missing that earlier :D

Post Reply

Return to “QCAD 'How Do I' Questions”