Page 1 of 1

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

Posted: Fri Jun 14, 2024 8:40 am
by artisanicview
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.

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

Posted: Fri Jun 14, 2024 8:57 am
by andrew
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.

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

Posted: Fri Jun 14, 2024 9:28 am
by CVH
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

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

Posted: Fri Jun 14, 2024 1:57 pm
by artisanicview
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.

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

Posted: Fri Jun 14, 2024 2:11 pm
by andrew
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

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

Posted: Sat Jun 15, 2024 9:32 am
by CVH
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