Merge Command Line

Hi all,

Operating System: Windows 11
QCAD Version: QCAD Trial 3.32.5

I’m brand new to QCAD as of today and am looking at this as an option for merging .dxf files using the command line tools found here: QCAD - QCAD Command Line Tools

So far I have been unsuccessful. I created two .dxf files in AutoCAD and have confirmed I can import them in QCAD. I placed the two files in a directory on my C drive as well as the xml file.

“C:\TestMerge\Comp1.dxf”
“C:\TestMerge\Comp2.dxf”
“C:\TestMerge\merge.xml”

Finally, I opened a command prompt, set my directory to the QCAD program folder and then ran the merge command:

cd “C:\Program Files\QCAD”
merge.bat -f -t 2013 -o C:\TestMerge\merged.dxf C:\TestMerge\merge.xml

It seems to run successfully, but I cannot find the merged .dxf file anywhere. Can anyone provide some insight as to what I am doing wrong?

Thanks!
Comp2.dxf (82.6 KB)
merge.xml (295 Bytes)
Comp1.dxf (86.2 KB)

Hi, and welcome to the QCAD forum.

All seems fine … Except perhaps Slash vs Back-Slash

-o "C:\TestMerge\merged.dxf"

Is understood by Win on the Command Line but in QCAD code it may be required to use:

<item src="C:/TestMerge/Comp2.dxf">

What does the next do for you:

merge.bat -f -t 2013 -o "C:\TestMerge\merged.dxf" "C:\TestMerge\merge.xml"

Quotes should only be required when there are spaces in the folder and/or file name.

We expect a file called merged.dxf under C:\TestMerge\ and overwritten if so.
Is there anything in the OS Command dialog that points to an error?

Regards,
CVH

Morning,

Thanks for taking a look. I tried switching the slashes and using the quotations but unfortunately no luck.

I also created a blank .dxf called merged.dxf in the directory in case it needed an existing .dxf in order to work and still no luck. This is what is returned in the command line:

C:\Program Files\QCAD>merge.bat -f -t 2013 -o "C:\TestMerge_QCAD\merged.dxf" "C:\TestMerge_QCAD\merge.xml"
QCAD version  3.32.5
08:03:02: Debug:    loading plugins...
08:03:03: Debug:    RPolygonPlugin::init
08:03:03: Debug:    RProScriptsPlugin::init: trial


You are using a trial version of QCAD Professional.
If you would like to use this software productively,
please purchase the full version for a small license fee from our
Online Shop at:
https://qcad.org/shop
Thank you for trying this add-on!

Your script will start in 15 seconds...


08:03:18: Debug:    RProxiesPlugin::init: trial
08:03:18: Debug:    RTracePlugin::init: trial
08:03:19: Debug:    RDwgPlugin::init: trial
08:03:19: Debug:    loading static plugins...

*Note I did change my directory name to “TestMerge_QCAD” but updated the merge.xml and everything.
merged.dxf (81.2 KB)
Comp2.dxf (82.8 KB)
merge.xml (305 Bytes)
Comp1.dxf (86.2 KB)

Hi,

Using QCAD 3.32.4 trial …
Your (older) files are in my download folder as Admin.
OS command line instruction from within the QCAD installation folder:

merge.bat -f -t 2013 -o "C:/Users/Admin/Downloads/merged-CVH.dxf" "C:/Users/Admin/Downloads/merge.xml"

Content of the XML:

<?xml version="1.0" encoding="UTF-8"?>
<merge xmlns="http://qcad.org/merge/elements/1.0/" unit="Millimeter">

    <item src="C:/Users/Admin/Downloads/Comp1.dxf">
        <insert x="0" y="0"/>
    </item>

    <item src="C:/Users/Admin/Downloads/Comp2.dxf">
        <insert x="0" y="0"/>
    </item>

</merge>

Export by QCAD is what we can expect of importing two drawings in a new drawing as Blocks.
Basically creating a New drawing + twice an Import, essentially a copy/paste and that Saved or exported, all in the background.

merged-CVH.dxf (98.8 KB)
Nothing to it but mind the details. :wink:

Regards,
CVH

Wait, sorry am I missing something right now? Everything worked fine for you?

I see you were using the forward slashes in the command prompt as well so I just tried that too, it’s still not creating the merged.dxf…