Problem with opening and exporting large dxf file

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
edith88
Newbie Member
Posts: 4
Joined: Thu Feb 06, 2025 6:10 pm

Problem with opening and exporting large dxf file

Post by edith88 » Tue Sep 23, 2025 10:38 pm

Hi everyone!

Qcad version: 3.21.3.0 (3.21.3)
Windows 10, 8 GB RAM, 932 GB HDD, 238 GB SSD, NVIDIA GeForce GTX 1650 (4 GB), Intel(R) UHD Graphics 630 (128 MB) (Sorry, I have no idea which of these informations are important.)

I know that too large files are common topic here, but I don't know how to solve this problem (if it can be solved at all).

I created a probably too large (31 MB) dxf drawing in Qcad put together from about 1700 drawings (also created in Qcad) of an archaeological site. It took Qcad forever to open it every time (5-10 minutes), and it froze many times, but so far I could edit the drawing. The problem is that now it is just unable to open it. As I read the forum, I understand that it might be a too huge file for Qcad to handle.

Earlier I wanted to export it as a PDF, but it is impossible, because there are too many and too thick lines in a very small area (the objects are aligned with reference points - EOV coordinates), so I use "Screen-based Linetypes" to see every object properly.
Bitmap export also would be fine, but it froze almost every time I tried. I only have one png file saved, but it is not the final version.

I tried to open it with LibreCad and Qgis, but not all the information and line properties are transfered, and I do not want to edit it again.

So my question is that I created this drawing all wrong? Qcad is not suitable for creating that kind of drawing? Should I use Autocad instead? Or is there any chance to open and save this drawing in a bitmap file somehow?

Here is a link to the files: https://we.tl/t-fxdI5ebCiw

Thanks in advance,
Edit

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

Re: Problem with opening and exporting large dxf file

Post by CVH » Wed Sep 24, 2025 5:41 am

Hi,

On the we-transfer I found one DXF and one PNG file.
Both around 30Mb large.

The size is not really the threshold, it is a combination of how many entities and how complex.

QCAD 3.21.3.0 was released on 2018/09/18, about 7 years ago.
Since then, many bugs were fixed and several performance improvements were implemented.
See QCAD Changelog

Your best option is to update QCAD. :wink:

I opened the DXF file with my trustworthy QCAD release 3.26.7.0 on an old Win7 PC with HDD without any problems.
Loading doesn't really takes forever, navigating with everything visible may exhibit some lagging.


The biggest issue is probably the complexity.
A vast amount of control-points Splines with many up to a very high control-point count.
Hatches based on such Splines.
Text as a cross 'X' marks the spot.
Inline text formatting for simple text.
...
..
edith88 wrote:
Tue Sep 23, 2025 10:38 pm
So my question is that I created this drawing all wrong? Qcad is not suitable for creating that kind of drawing? Should I use Autocad instead?
No, not really ... You are pushing against the limits ... That choice is not up to me.
edith88 wrote:
Tue Sep 23, 2025 10:38 pm
Or is there any chance to open and save this drawing in a bitmap file somehow?
This might or might not be a problem but it is also pushing against the limits.
All depends on how compact, how portable, you want this picture to be.
IrfanView loads and scales your PNG to fit the screen in just over 8000ms.

It concerns a slanted area of roughly 300 by 130 units.
Or an upright area of roughly 325 by 240 units, aspect ratio 0.74.
The example PNG is 23600 x 16800 pixels (396.48 MPixels) in 24bit color, aspect ratio 0.71.
Maximum size is 2'147'483'647 (bytes) with 4 bytes per pixel that is a maximum of 536'870'911 pixels.

Usually the issue is resolution.
23600 / 325 ≈ 72 pixels per drawing unit (=mm), a minimal Lineweight of 0.09mm is then a detail of 6 pixels.
What should be adequate.

Converting or rendering in pixels may indeed take almost forever because of the high entity count. :wink:
Already 70'836 entities in Model_Space (≈16% are (very) complex) and many more in unused Blocks.
edith88 wrote:
Tue Sep 23, 2025 10:38 pm
Earlier I wanted to export it as a PDF, but it is impossible
PDF should not be an issue if you select a larger paper size.
Remind that the Lineweight doesn't scale, 0.50mm (ISO) will always be half a mm wide on paper.
Only 840 by 594 lines, side by side, fit on a full A3 sized page.

The advantage of PDF is that it holds scalable vector information.
One can zoom in/out in a PDF up to some degree.
A viewer can display it screen large, screen wide or in almost any scale.
A bitmap would get coarser the more you zoom in.

In Print Preview or paper mode "Screen-based Linetypes" is turned OFF because it will always use Linetypes and weights as defined.
It is never printed as displayed in this mode what is intended for 'On screen' with a much lesser resolution than printers/plotters.
Weights are straight-forward, it are historical pen sizes, Linetypes rendering or line patterning may differ a lot.

Regards,
CVH

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

Re: Problem with opening and exporting large dxf file

Post by CVH » Thu Sep 25, 2025 5:14 am

Exporting to A0 PDF does not pose any insurmountable problems :):

17651_2019-2020_PMF_OF.pdf
(12.39 MiB) Downloaded 214 times

First set your paper size to A0 in the Drawing Preferences.
Avoiding the thick lines on a too small paper size for the vast amount of details in this drawing. :wink:

The tweak to avoid a slow reaction, stalling or even crashing is:
- Save the original layer state (YM)
- Hide all layers (YH)
- Show layer '08-1 ....' (Contour of actual explored area)
- Print Preview (Ctrl-Shift-P) (What would kinda stall in the original layer state)
- If not already -> Hit tool button 'Auto fit drawing to page(s)' (What would otherwise consider all drawing data)
- Activate the original layer state (Y1) ... Wait for rendering to complete
- Hit tool button 'Export to PDF...'


I haven't been able to export it as a bitmap yet for some unknown reason:
Error while generating Bitmap file 'abc.png': Image is empty

A partial seems to be working, I selected only the thicker Spline just above tag 648 (50px/unit):

abc (3).png
abc (3).png (64.78 KiB) Viewed 11814 times

Adequate would be: >=2px for a 0.09mm Lineweight or >=22.222...px/unit


Regards,
CVH

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

Re: Problem with opening and exporting large dxf file

Post by CVH » Thu Sep 25, 2025 10:49 am

Finally got it working.
I have to add that QCAD can be stubborn sometimes. :o

Started with replacing (almost) zero-length entities by points.
- Layer '02 jelenség aljvonala': 78 Line entities are zero long. (looks like a dotted area)
--> Select those with the Selection Filter > Misc .. Store positions > Delete > PO > Misc .. Use positions
- Same layer: Several lines are less than 0.001 long.
--> App.Prefs. Info .. Store positions .. Store middle point of segments. (Midpoint of a line is not an option)
--> Select the ultra short lines with the Selection Filter > OC > Misc .. Store positions > Delete > PO > Misc .. Use positions
- Layer '07 csontváz': 1 Spline entity is less than 0.001 long.
--> Select it > XP > Misc .. Store positions > Delete > PO > Misc .. Use positions
- Layer '04 feltételezett él': 1 Line entity is zero long.
--> Same process as for the first 78 Line entities

Simply deleting entities found by MZ would change the appearance, especially when intended as dotted.


Exporting to a bitmap is supported by QImageWriter (Qt)
An important note is that QImageWriter assumes exclusive control over the file or device that is assigned.

To start I turned most layers off except layer 'layer '08-1 ....' (Contour of actual explored area)
Displaying more layers on a next attempt.
Several, sometimes successive attempts failed with: Error while generating Bitmap file 'abc.png': Image is empty
Once failed, exporting something simple failed too.
Perhaps destroying the QImageWriter object is not per immediately, the view or the scene is not refreshed.

I would advise:
- Attempt your bitmap export in a new and fresh QCAD session.
- Avoid more than one gigantic export in the same session.
- Avoid to overwrite, control may not be exclusive.
(Selecting in the Windows file dialog may already present a preview of the old file content)
- Don't have the target open or previewed in another window, dialog or application for the same reason.
- Select the contour on 'layer '08-1 ....' and export the bitmap based on the bounding box of a selection.
(Failed less generally speaking but the reason may be something completely different)

17651_2019-2020_PMF_OF (10).png
Content of all visible layers. (25px/drawing unit)
17651_2019-2020_PMF_OF (10).png (8.37 MiB) Viewed 11732 times

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”