Feature request: Merge two DXF files together instead of import one file on top of the other.

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
artisanicview
Active Member
Posts: 33
Joined: Sat Jun 19, 2010 6:23 pm

Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by artisanicview » Fri Jun 14, 2024 8:40 am

I do try to get used with the workflow of the QCAD/CAM and because I do need to generate a few dozens of Gcode files every day from DXF files I do need to simplify the process as much as possible.

One thing that bothers me a lot it is the fact that for every DXF file that I do need to generate a Gcode file from it, I do need to open the DXF template with the tools for the machine, after that I do need to go to the File/Import and choose the DXF file that I do need to generate the Gcode file, search for the Zero point of the drawing and be careful to drop the file exactly at the zero point and only once, press escape key, press the CAM Configuration button, go to "Output file:" dialog and type the same name as the imported DXF file, set a "Program number and name:" and type the same name as typed into the dialog box before, press the OK button, and only after that begin to make the actual setup.

I do think that there are a lot of redundant and unnecessary steps, all this can be greatly simplified if I can can have a command-line tool that can merge the template file into the DXF file that I do need to generate the Gcode for and set automatically the "Output file:" path as the actual DXF file and also to write automatically the "Program number and name:" as the name of the DXF file.

The actual workflow is good if you have one or two files to process from time to time, but if you need to process a few dozens of them every day you will find this repetitive steps quite bothering.

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

Re: Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by andrew » Fri Jun 14, 2024 8:57 am

QCAD/CAM automatically merges in a DXF template file with the same name as the post processor file (if available) when setting / switching the post processor.

Let's say, your post processor is called "MyGCode", implemented in postprocessors/MyGCode.js.

Copy your DXF file with the tool definitions (the one you currently start with) to postprocessors/MyGCode.dxf.

The workflow is now as follows:

- Draw your file or open your existing drawing
- Set the post processor to "MyGCode"
- QCAD/CAM automatically loads the tools from postprocessors/MyGCode.dxf

Your MyGCode.dxf template file can also contain predefined layers or even content such as an outline of the available table surface area, etc.

Note: Any visible content of the template file is automatically placed on a locked layer when merging, so it is only visible but not selectable.

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

Re: Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by CVH » Fri Jun 14, 2024 9:28 am

Additionally.

- Moving the parts is mandatory as long as QCAD/CAM does not support setting a zero point.
In a way that is supporting a UCS.
- Output file name is something one could automate within a custom postprocessor.
- Program number and name is but a text field of the CAM Configuration dialog.

Look up "initConfigDialog" in the forum for example.
Here is an overview of all dialog widgets:
https://www.qcad.org/rsforum/viewtopic. ... 81&#p42687

In Andrew"s words: QCAD/CAM is designed to be extremely flexible / customizable.
All depends on how you mold it to your needs. :wink:
There is not one shoe that fits all.

Regards,
CVH

artisanicview
Active Member
Posts: 33
Joined: Sat Jun 19, 2010 6:23 pm

Re: Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by artisanicview » Fri Jun 14, 2024 1:57 pm

andrew wrote:
Fri Jun 14, 2024 8:57 am
Copy your DXF file with the tool definitions (the one you currently start with) to postprocessors/MyGCode.dxf.
Thank you for this tip, one step less to do.

However, if I do try to open the "part_nr_7.dxf" file (for example), and press the "CAM export" button, by default the filename of the resulting Gcode will be the name of the postprocessor used instead of the name of the opened DXF file. How I can change this behavior? I do need that the output Gcode file to have the same name as the opened DXF file ("part_nr_7.xxl") and be saved into the same folder as the dxf file.
Last edited by artisanicview on Fri Jun 14, 2024 2:34 pm, edited 1 time in total.

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

Re: Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by andrew » Fri Jun 14, 2024 2:11 pm

The output file name should indeed default to the file name of the loaded drawing (xy.nc for xy.dxf), not the post processor name.

If you cannot solve the problem, please attach or e-mail your drawing file (DXF), your template file (DXF) and your post processor or indicate which standard post processor you are using.

Please indicate also the complete steps you follow, for example:

- Load file xy.dxf
- Set post processor
- ...
- CAM Export

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

Re: Feature request: Merge two DXF files together instead of import one file on top of the other.

Post by CVH » Sat Jun 15, 2024 9:32 am

artisanicview wrote:
Fri Jun 14, 2024 1:57 pm
However, if I do try to open the "part_nr_7.dxf" file (for example), and press the "CAM export" button, by default the filename of the resulting Gcode will be the name of the postprocessor ...
Following Andrew's guidelines I can not replicate your issue.
The proposed filename in the export dialog is based on the drawing and not on the template.

Scanned 14 years of posts.
Would it be possible to indicate your operating system and QCAD version?
See above forum rules in red.
This can be helpful for Andrew in determining the cause of your problem.

Regards,
CVH

Post Reply

Return to “QCAD/CAM”