Page 1 of 1

Saving Only a single layer to DXF

Posted: Wed Jan 09, 2019 6:53 am
by TreestumpExhaustpipe
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.

Re: Saving Only a single layer to DXF

Posted: Wed Jan 09, 2019 7:13 am
by Husky
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?

Re: Saving Only a single layer to DXF

Posted: Wed Jan 09, 2019 7:56 pm
by TreestumpExhaustpipe
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.

Re: Saving Only a single layer to DXF

Posted: Wed Jan 09, 2019 9:53 pm
by Husky
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

Re: Saving Only a single layer to DXF

Posted: Thu Jan 10, 2019 1:00 am
by TreestumpExhaustpipe
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 ?

Re: Saving Only a single layer to DXF

Posted: Thu Jan 10, 2019 1:07 am
by andrew
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..

Re: Saving Only a single layer to DXF

Posted: Thu Jan 10, 2019 7:18 am
by Husky
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!

Re: Saving Only a single layer to DXF

Posted: Fri Jan 11, 2019 2:44 am
by TreestumpExhaustpipe
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 ?

Re: Saving Only a single layer to DXF

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

Re: Saving Only a single layer to DXF

Posted: Sat Jan 12, 2019 2:51 am
by TreestumpExhaustpipe
Thanks that is doable.