How can the speed of dwg2dwg.bat be improved

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
yamyam
Junior Member
Posts: 22
Joined: Fri Apr 19, 2024 2:31 am

How can the speed of dwg2dwg.bat be improved

Post by yamyam » Sat Sep 06, 2025 3:56 am

Hello everyone,

My QCAD version is QCAD Pro 3.30.1.0, and my OS is Windows 10.

Currently, I have a speed-sensitive project that requires the use of dwg2dwg.bat.
The running speed of dwg2dwg.bat is insufficient to meet the requirements. Are there any ways to improve its running speed?

Thank you very much!

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

Re: How can the speed of dwg2dwg.bat be improved

Post by CVH » Sat Sep 06, 2025 6:05 am

Hi,

Please include an example of your command line instruction.

The size but certainly the complexity of the file will have a profound influence.
Any chance that you can attach such a 'slow' example.

Remind that dwg2dwg.bat is just a batch file that calls QCAD.
This probably takes not longer than a few micro seconds.
  • - Prevent echoing
    - Starts qcadcmd.com with no GUI, allowing multiple instances, not using the standard auto start script but executing:
    scripts\Pro\Tools\Dwg2Dwg\Dwg2Dwg.js and passing all other parameters.
Dwg2Dwg.js is again a stub that will process the parameters and instructs QCAD what to do.

The batch file itself is not to blame. :lol: :wink:
Nor is Dwg2Dwg.js.

QCAD must start up in the background, the file must be imported and exported, changes must be applied to the document.

Regards,
CVH

yamyam
Junior Member
Posts: 22
Joined: Fri Apr 19, 2024 2:31 am

Re: How can the speed of dwg2dwg.bat be improved

Post by yamyam » Mon Sep 08, 2025 2:17 am

The command line instruction I used is:

Code: Select all

E:\\QCad\\qcadcmd.com -no-gui -allow-multiple-instances -autostart scripts\\Pro\\Tools\\DwgExplode\\DwgExplode.js %0 %*  -f -o output.dxf test.dwg
If I remove the -autostart option, the QCAD GUI launches instead, and the conversion does not complete.

I will check the DWG file to see if there is room for optimization. Thanks, CVH!

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

Re: How can the speed of dwg2dwg.bat be improved

Post by CVH » Mon Sep 08, 2025 5:30 am

Hi,

Your command line instruction looks like a mix-up of things.

The content of dwgexplode.bat is:

Code: Select all

@echo off
qcadcmd.com -no-gui -allow-multiple-instances -autostart scripts\Pro\Tools\DwgExplode\DwgExplode.js %0 %*
%0 refers to the name of the batch file itself as it was called, here "dwgexplode.bat".
%* stands for all parameters specified in the OS command line that calls the batch file.

You can call that from the OS command line with for example:

Code: Select all

E:\QCad\dwgexplode.bat -f -o output.dxf test.dwg
The very last parameter is typically the file to load: "test.dwg".
Other parameters are then: "-f -o output.dxf"

Remark that no path was specified for the in- or output file.
What would result in the current, the QCAD application path.

-autostart [script file]
  • Starts the given script file instead of the default
    scripts/autostart.js. Note that with this option,
    QCAD is not started but rather the application
    implemented in the given script.
The argument after -autostart
scripts\Pro\Tools\DwgExplode\DwgExplode.js doesn't mount an application.
It executes the DwgExplode stub.
And that handles the parameters.

But your instruction line includes placeholders %0 %* AND the parameters for them.
I think that you can't mix that.

Removing only "-autostart" mounts the QCAD application (supposedly without a GUI) but doesn't executes a script.
It may attempt to load a drawing file.
To execute a script after the QCAD application is mounted requires an argument after an -exec switch.
Optionally followed by option arguments for that script.

I am not sure that you can initiate the pro script DwgExplode.js with your instruction line excluding "-autostart".
What then follows after -allow-multiple-instances is probably ignored as bogus.


I think that Windows ignores double backslashes.
Also had to use normal slashes instead, sometimes it is auto-fixed, sometimes not.
On script level it are normal slashes.

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”