Page 1 of 1

Strange things happening with blocks in file

Posted: Thu Jun 06, 2019 7:31 pm
by garciadelcastillo
Hi there,

Problem: I am running into a strange problem with some block references in a reduced number of cad files being rendered in strange places.

Description: I have a routine that batch-rasterizes cad files. The script relies on "dwg2bmp" with the "-zoom-all" argument. However, I started noticing that for some files, the zoom all option zoom out too much to objects that didn't seem to be on the drawing.

For example, for the following file:
(220.19 KiB) Downloaded 182 times

I get a rasterized image like this:
family_house_2_first.dwg.png (6.95 KiB) Viewed 3184 times
If I open the file in a different software and "zoom all", I get everything in the right place:
JLX_2019-06-06_14-11-49_ADSKMAC.png (62.43 KiB) Viewed 3184 times
However, when I open the same file with the QCAD GUI (no zoom all), I get this:
JLX_2019-06-06_14-11-02_ADSKMAC.png (40.33 KiB) Viewed 3184 times
Notice that in the QCAD version, the chair and computer on the desk of the lower right corner of room 210 are missing. On zoom all, I get the same view bounding box as in the rasterization process:
JLX_2019-06-06_14-20-07_ADSKMAC.png (4.97 KiB) Viewed 3184 times
Now, if I zoom on the brown dot at the bottom, the missing chair is there:
JLX_2019-06-06_14-20-19_ADSKMAC.png (7.37 KiB) Viewed 3184 times
But if I try to select it and zoom out, the selection box is offset by +3000 units!
JLX_2019-06-06_14-20-37_ADSKMAC.png (101.41 KiB) Viewed 3184 times
The missing laptop (part of the same block) is to be found on the top part of the drawing, but this one doesn't allow to be selected:
JLX_2019-06-06_14-21-15_ADSKMAC.png (85.51 KiB) Viewed 3184 times
So, I guess my question is if you think this is a problem with the files or with the way QCAD renders these strange blocks. This problem doesn't seem to appear when opening the files with other software.

Here is a collection of other files that have similar issues:
(6.93 MiB) Downloaded 227 times
Thank you so much in advance! :)

Re: Strange things happening with blocks in file

Posted: Thu Jun 06, 2019 8:47 pm
by andrew
These blocks use block transforms (a transformation matrix for block references). This is currently not supported by QCAD as it seems to be a rather uncommon feature of the DXF/DWG formats.

I've added a feature request at: ... sk_id=1895

Re: Strange things happening with blocks in file

Posted: Thu Jun 06, 2019 9:08 pm
by garciadelcastillo
Thank you andrew!

Re: Strange things happening with blocks in file

Posted: Mon Jun 10, 2019 6:04 pm
by garciadelcastillo
Hi Andrew,

Is there any way to detect which blocks use block transforms from the ECMAScript API? While the FR goes through, I would like at least to be able to remove those blocks from the drawing prior to rasterizing them.


Re: Strange things happening with blocks in file

Posted: Tue Jun 11, 2019 9:12 am
by andrew
Unfortunately not. QCAD does not import such transformation matrices at all.