Saving Only a single layer to DXF

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
TreestumpExhaustpipe
Junior Member
Posts: 12
Joined: Tue Jun 12, 2018 1:05 am

Saving Only a single layer to DXF

Post by TreestumpExhaustpipe » Wed Jan 09, 2019 6:53 am

I need to successively CNC individual layers of a DXF file, so I need separate DXF for each of them only containing the specific layer.
I have a lot of trouble doing that and I could not explicitly find it in the manual.

So how can I creat dxf's from each later in a master dxf containing all the layers.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2362
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Saving Only a single layer to DXF

Post by Husky » Wed Jan 09, 2019 7:13 am

Just to be sure: Your CAM is not able to handle Layer like show/hide etc) and you need to extract specific layer as a single dxf. Correct?
Work smart, not hard: QCad Pro

TreestumpExhaustpipe
Junior Member
Posts: 12
Joined: Tue Jun 12, 2018 1:05 am

Re: Saving Only a single layer to DXF

Post by TreestumpExhaustpipe » Wed Jan 09, 2019 7:56 pm

Correct, I never had a Cam that could do that AND work with my German Techno Isel Machines. The Isels are great, but their gcode flavor is from mars. Was a bad buy in that respect.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2362
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Saving Only a single layer to DXF

Post by Husky » Wed Jan 09, 2019 9:53 pm

Thanks for clarification.

QCAD doesn't has a tool for that and this is just a kind of workaround. Without an example drawing it is also a bit of fishing in muddy water what means there is room for improvements ... :wink:

Open the dxf with the layer collection - I'll call it Alllayer.dxf
Then ...
Layer List:
1. Switch all Layer to visible,
2. Right click on the layer which has to be isolated - choose select layer.
Menu:
3. Select -> Invert Selection
4. Delete
Menu:
5. Layer -> Purge unused Layers
6. Save as: Save the dxf regarding to the choosen layer
Close the drawing (?)
7. Open the "Alllayer.dxf" again and repeat this procedure for the next layer which has to be separated.

Tip: Work first with a copy of Alllayer.dxf until you are familiar with the procedure. Just in the case that a click was faster than expected ... e_surprised
Work smart, not hard: QCad Pro

TreestumpExhaustpipe
Junior Member
Posts: 12
Joined: Tue Jun 12, 2018 1:05 am

Re: Saving Only a single layer to DXF

Post by TreestumpExhaustpipe » Thu Jan 10, 2019 1:00 am

Thanks for the workaround, this is about how I am doing it currently but it is cumbersome if you have a lot of designs. I was hoping that QCAD does this natively, as it really should.

Do you know of any other software application I can use that can do this by importing a Qcad created dxf ?

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

Re: Saving Only a single layer to DXF

Post by andrew » Thu Jan 10, 2019 1:07 am

You might want to consider writing a QCAD script that does that for you:
- iterate through layers
- copy layer contents to new (offscreen) document
- save document, e.g. as filename_layername.dxf

I doubt you will find an application that does that for you. It seems a rather specific / unusual task..

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2362
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Saving Only a single layer to DXF

Post by Husky » Thu Jan 10, 2019 7:18 am

andrew wrote:
Thu Jan 10, 2019 1:07 am
I doubt you will find an application that does that for you. It seems a rather specific / unusual task..
I've to second that - I've never seen a software which has this potential. To write a script for QCAD makes sense to me!
Work smart, not hard: QCad Pro

TreestumpExhaustpipe
Junior Member
Posts: 12
Joined: Tue Jun 12, 2018 1:05 am

Re: Saving Only a single layer to DXF

Post by TreestumpExhaustpipe » Fri Jan 11, 2019 2:44 am

Done a lot by Lisp programmers for autocad. It seems to be coming up as an autocad user often.
"https://www.cadtutor.net/forum/topic/47 ... le/?page=1"
" https://jtbworld.com/autocad-export-lay ... todwgs-lsp"

and a commercial application

"https://www.jetcam.com/dxf-splitter.htm"

So it is not so far fetched or obscure really as many users other than me need it and clearly there is a commercial interest in it too, so the question must have been asked a lot for them to create such a commercial application. To me it is duh! obvious that it is very necessary.
It is something I need constantly.
In my case I have to make reference planes that must be part of the drawing so I can manufacture in large quantity as one example. There are many more.
There is no way around it. I need to split the layers out.

What is the Qcad scripting language. Hopefully not python? That I dont want to learn. If so any other scripting language options ?

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

Re: Saving Only a single layer to DXF

Post by andrew » Fri Jan 11, 2019 10:00 am

TreestumpExhaustpipe wrote:
Fri Jan 11, 2019 2:44 am
What is the Qcad scripting language.
ECMAScript ("JavaScript"):
https://qcad.org/en/tutorial-script-programming

TreestumpExhaustpipe
Junior Member
Posts: 12
Joined: Tue Jun 12, 2018 1:05 am

Re: Saving Only a single layer to DXF

Post by TreestumpExhaustpipe » Sat Jan 12, 2019 2:51 am

Thanks that is doable.

Post Reply

Return to “QCAD 'How Do I' Questions”