Dimension Scaling not working

Use this forum for all posts and questions about the free QCAD Community Edition version 3

Moderator: andrew

Post Reply
botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Dimension Scaling not working

Post by botobi » Thu Oct 06, 2022 3:00 pm

I'm using QCAD Community Edition 3.27.7 on Windows 11.

When I started my drawing, I was able to change the size scale factor of (existing) dimensions using "Edit/Drawing Preferences/Dimension/Dimension Settings/Size scale factor". However, suddenly this feature stopped working and now I cannot switch the dimension scale factor any longer.

I used this feature to be able to adapt the scale factor of the dimensions when printing in different scales.
I.e. all my drawings are in "original" size but when it comes to printing, I print some parts in scale 1:2 (in which case I used to set the size scale factor of the dimensions to 2) and some parts in scale 1:10 (in which case I used to set the scale factor of the dimensions to 10). Using this procedure, the dimensions have the same size (font size, arrow size, gaps etc.) on both drawings.

I have attached the drawing, that shows the described issues.

Is this a bug in QCAD or am I using the feature the wrong way?
Attachments
schamotte.dxf
(320.37 KiB) Downloaded 1120 times

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

Re: Dimension Scaling not working

Post by CVH » Thu Oct 06, 2022 6:42 pm

Hi,
there seems to be something ... Even using QCAD Pro 3.27.6.0

With a new drawing I can do this once but I can't change it back nor can I undo the first change.

It is best that you report it as a bug.,

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 5061
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Dimension Scaling not working

Post by Husky » Thu Oct 06, 2022 8:54 pm

Hi,
botobi wrote:
Thu Oct 06, 2022 3:00 pm
I'm using QCAD Community Edition 3.27.7 on Windows 11.

However, suddenly this feature stopped working and now I cannot switch the dimension scale factor any longer.
That happened in the same QCAD version? If not what was the prior version?
Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."

botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Re: Dimension Scaling not working

Post by botobi » Thu Oct 06, 2022 9:08 pm

Yes, that happened in the same vesion. When I started the drawing it was working. But after some time it stopped working.
I had the same issue in the previous version (which was 3.24 if I remember correctly) which was the reason for me to update to 3.27.7.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 5061
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Dimension Scaling not working

Post by Husky » Thu Oct 06, 2022 9:45 pm

Ok, thanks. Is the drawing completely done in QCAD or was an other CAD program part of the design process?

So far I can reproduce the issue but I've still no strong opinion on why that happened. It is not only the scale issue - the Property Editor goes crazy too ...

Can you imagine anything what could have triggered this behavior?
Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."

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

Re: Dimension Scaling not working

Post by CVH » Thu Oct 06, 2022 10:06 pm

Husky wrote:
Thu Oct 06, 2022 9:45 pm
the Property Editor goes crazy too ...
The PE seems fine in 3.27.6.0
2 new properties were added in .7 ... What with .8?

Regards,
CVH

botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Re: Dimension Scaling not working

Post by botobi » Fri Oct 07, 2022 7:16 am

Husky wrote:
Thu Oct 06, 2022 9:45 pm
Ok, thanks. Is the drawing completely done in QCAD or was an other CAD program part of the design process?

So far I can reproduce the issue but I've still no strong opinion on why that happened. It is not only the scale issue - the Property Editor goes crazy too ...

Can you imagine anything what could have triggered this behavior?
The drawing was entirely done in QCAD. No other tool involved.
I have no idea what could have triggered this behavior. However, I have completely removed the dimensions and re-added them. After that, scaling the dimensions worked for a short while. Then I did some printing (involving translating the whole drawing to move the desired part to the printing area and changing the print scale (and also the dimension scale)) and suddenly I was no longer able to change the dimension scale. But I didn‘t find out so far, which operation exactly caused that issue.

botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Re: Dimension Scaling not working

Post by botobi » Fri Oct 07, 2022 7:34 am

Probably it's worth mentioning. that after having had this issue in 3.24 or so, I tried to upgrade to version 3.27.7.
Since Im working on a 64-bit Windows machine, I downloaded the 64-bit installer and executed it and it seemd to have installed successfully. However, QCAD did not start. It showed the splash screen and loaded the plugins. Then it sowed a commanline window for a fraction of a second and shut down immediately. It did not show the QCAD drawing UI at all.
So I had to download the 32-bit version which installed and worked fine (except for the dimension scaling).

I don‘t think that the 64-bit installation issue described above is related to the dimension scaling issue because I had the scaling issue already in the previous version and you are able to reproduce it with my drawing in your QCAD version.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 5061
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Dimension Scaling not working

Post by Husky » Fri Oct 07, 2022 8:20 am

I have the feeling that some kind of data association is incorrect.
Why?
New drawing ...
1. Drawing Preferences / Dim Label Format = Decimal
creating a dim / selecting = Property Editor reads that it is a Scientific dim ... two times.

Husky-2022.10.06-14.png
Husky-2022.10.06-14.png (56.62 KiB) Viewed 29729 times

2. Then changing the "Size scale factor" in Drawing Preferences / Dim from 1 to 10 or vice versa will flood the Property Editor with Dim Label fields ...

Husky-2022.10.07-15.png
Husky-2022.10.07-15.png (50.08 KiB) Viewed 29729 times
@ Andrew
That happens in CE 3.27.8.0. Maybe you can find the time to look into this. Thanks.

@botobi
I'm not sure that the change in a dim "Size scale factor" is program intern actually used to change the dim scale factor. e_surprised I'm sure Andrew has a better answer than me to that question ... :oops:
Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."

botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Re: Dimension Scaling not working

Post by botobi » Fri Oct 07, 2022 8:57 am

Husky wrote:
Fri Oct 07, 2022 8:20 am
@botobi
I'm not sure that the change in a dim "Size scale factor" is program intern actually used to change the dim scale factor. e_surprised I'm sure Andrew has a better answer than me to that question ... :oops:
🙃 It is - somehow - at least when I start a new drawing.

botobi
Newbie Member
Posts: 6
Joined: Thu Oct 06, 2022 2:29 pm

Re: Dimension Scaling not working

Post by botobi » Fri Oct 07, 2022 9:08 am

There‘s another issue: In the previous version, when I selected a dimension, I had a "dimension scale factor" field in the property editor. With version 3.27.7 the "dimension scale factor" field in the PE has disappeared.

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

Re: Dimension Scaling not working

Post by CVH » Fri Oct 07, 2022 5:06 pm

botobi wrote:
Fri Oct 07, 2022 8:57 am
It is - somehow - at least when I start a new drawing.
Indeed, one can change it once with a new drawing.
Husky wrote:
Fri Oct 07, 2022 8:20 am
I'm not sure that the change in a dim "Size scale factor" is program intern actually used to change the dim scale factor.
I am also used to the fact that the displayed size is scaled by "Size scale factor" and by Style Property "Overall scale".

Also, it should work 'aftermath' and is proposed as a fix:
https://www.qcad.org/rsforum/viewtopic. ... 560#p36560
https://www.qcad.org/rsforum/viewtopic. ... 408#p28408

Seen something similar to this before:
https://www.qcad.org/rsforum/viewtopic.php?f=76&t=9461

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 5061
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Dimension Scaling not working

Post by Husky » Fri Oct 07, 2022 10:23 pm

botobi wrote:
Fri Oct 07, 2022 8:57 am
Husky wrote:
Fri Oct 07, 2022 8:20 am
@botobi
I'm not sure that the change in a dim "Size scale factor" is program intern actually used to change the dim scale factor. e_surprised I'm sure Andrew has a better answer than me to that question ... :oops:
🙃 It is - somehow - at least when I start a new drawing.
Correct but it can break at any time. However - if that happens I still noticed after editing the scale in DP/dim some kind of respond within the dims in the drawing. Not a scale change but a actualization of the dims or even a change in dim text color. That means QCAD CE is still trying to process the changed information but for some reason fails ...
botobi wrote:
Fri Oct 07, 2022 9:08 am
There‘s another issue: In the previous version, when I selected a dimension, I had a "dimension scale factor" field in the property editor. With version 3.27.7 the "dimension scale factor" field in the PE has disappeared.
Correct - "Scale" is missing and two incomplete fields for "Linear Format" are now listed. The order makes no sense to me and it also doesn't represent the correct settings below Drawing Preferences. Set is Decimal and the PE tells as it is Scientific. e_confused

Husky-2022.10.07-03.png
Husky-2022.10.07-03.png (201.29 KiB) Viewed 29668 times

This said - this is nothing which can be fixed with an adjusted program setting etc.. This goes to the core of the programing which is out of my hands. :oops:
Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."

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

Re: Dimension Scaling not working

Post by CVH » Sat Oct 08, 2022 2:42 am

Husky wrote:
Fri Oct 07, 2022 10:23 pm
Correct - "Scale" is missing and two incomplete fields for "Linear Format" are now listed.
Same here: https://www.qcad.org/rsforum/viewtopic. ... =15#p38107
And there is a kinda fix for it but wendi reported that arrows turn into architectural ticks. :roll:

Nothing was fixed at that time (See GitHub), that topic was moved to the CE forum by Andrew.
https://www.qcad.org/rsforum/viewtopic. ... =15#p38105

An overview of the QCAD features:
https://www.qcad.org/en/documentation/features
Features in blue italic are available in QCAD Professional only.
And that includes Styles ... :(

The specific difference between 3.24.0.0 and 3.27.8.0 would have occurred before version 3.26.4.9
At that time Andrew implemented Style overrides.
I have this logged in Centroids, that used document properties to get the dimension size for the Centroid label.
Husky reported that this didn't work under 3.26.4.9 and I changed all that code to read Style data (With the hints from Andrew).
Husky wrote:
Sat Oct 30, 2021 8:14 am
... I'm also wondering why the Annotation Text hight (based on the DIM Text hight value) is only used from the last saving status. Changes which should apply for new calculation are ignored until the dxf is saved again ...
- - - - -

Surely there is something wrong with the Property Editor in CE and the handling of Style overrides.
One should report this as a CE bug.

There is also something with QCAD Pro there we can't change the "Size scale factor" more than once.
A CE bugreport exists: https://www.ribbonsoft.com/bugtracker/i ... sk_id=2405
I added a comment for QCAD Pro. :wink:

Regards,
CVH

superbem
Registered Member
Posts: 1
Joined: Thu Apr 17, 2025 1:34 am

Re: Dimension Scaling not working

Post by superbem » Sat Dec 06, 2025 6:16 pm

Hi,

I’ve encountered this bug when setting Edit → Drawing Preferences → Dimension Settings → Size Scaling Factor. The adjustment only applies to dimensions created during the current session, which seems unintended behavior.

It would be helpful to have an option that applies the scaling factor to all existing dimensions.

For reference, here’s a script that resets all dimensions so the Size Scaling Factor works consistently across the entire drawing.

Code: Select all

	// g++ remove_dim_scale.cpp -o remove_dim_scale -std=c++20
	/*
	remove_dim_scale.cpp

	Simple C++ tool that edits an ASCII DXF (R12/R13/R14/R15-compatible) file to:
	- set header $DIMSCALE (overall dimension scale) to 1.0 if present
	- set DIMSTYLE table entries' DIMLFAC (group code 144) to 1.0 if present
	- remove per-entity dimvar overrides stored in 1002 "{...}" chunks (commonly used
	to store per-dimension overrides)

	Usage: ./remove_dim_scale input.dxf output.dxf

	This is a line-oriented tolerant editor (it operates on group-code/value pairs).
	It is conservative: if it cannot confidently parse a pair it will copy it unchanged.

	Limitations:
	- Only handles ASCII DXF files (not binary)
	- Assumes group codes and values are on separate lines (standard DXF ASCII)
	- Does not attempt to interpret binary or embedded objects or write handles
	- Attempts to be robust for common DXF R12..R15 variants

	Author: ChatGPT (GPT-5 Thinking mini)
	*/

	#include <bits/stdc++.h>
	using namespace std;

	static string trim(const string &s) {
		size_t a = 0; while (a < s.size() && isspace((unsigned char)s[a])) ++a;
		size_t b = s.size(); while (b > a && isspace((unsigned char)s[b-1])) --b;
		return s.substr(a, b-a);
	}

	int main(int argc, char** argv) {
		if (argc != 3) {
			cerr << "Usage: " << argv[0] << " input.dxf output.dxf\n";
			return 1;
		}
		string inpath = argv[1];
		string outpath = argv[2];

		ifstream fin(inpath);
		if (!fin) { cerr << "Failed to open input: " << inpath << '\n'; return 2; }

		// Read all lines (preserve exact lines for output)
		vector<string> lines;
		string line;
		while (std::getline(fin, line)) lines.push_back(line);
		fin.close();

		vector<string> out;
		out.reserve(lines.size());

		// We'll process the file as pairs: group-code line, value line
		// but be robust if file ends unexpectedly.
		bool in_header_section = false;
		bool in_tables_section = false;
		bool in_dimstyle_table = false;
		bool skipping_1002_block = false; // when true, skip lines until matching 1002 '}' encountered

		for (size_t i = 0; i < lines.size();) {
			string code = trim(lines[i]);
			string value = (i + 1 < lines.size()) ? lines[i+1] : string();

			// If currently skipping a 1002 override block, check for end condition
			if (skipping_1002_block) {
				// We skip the current pair (code+value). Look for 1002 with value "}" to stop.
				if (code == "1002") {
					string vtrim = trim(value);
					if (!vtrim.empty() && (vtrim == "}" || vtrim == "\}")) {
						// end of override block: skip this closing line too and resume
						skipping_1002_block = false;
						i += 2; // move past this pair
						continue;
					}
				}
				i += 2; // skip
				continue;
			}

			// Detect section changes by looking for SECTION/ENDSEC pairs and TABLES/TABLE
			if (code == "0" && trim(value) == "SECTION") {
				// copy the SECTION pair
				out.push_back(lines[i]); out.push_back(lines[i+1]); i += 2;
				// next pair should be 2 <section name>
				if (i+1 < lines.size()) {
					string c2 = trim(lines[i]); string v2 = trim(lines[i+1]);
					if (c2 == "2") {
						string secname = v2;
						if (secname == "HEADER") { in_header_section = true; in_tables_section = false; in_dimstyle_table = false; }
						else { in_header_section = false; }
						if (secname == "TABLES") { in_tables_section = true; } else { in_tables_section = false; }
					}
					// copy them as well
					if (i < lines.size()) { out.push_back(lines[i]); }
					if (i+1 < lines.size()) { out.push_back(lines[i+1]); }
					i += 2;
				}
				continue;
			}

			if (code == "0" && trim(value) == "ENDSEC") {
				// leave any table/dimstyle state
				in_header_section = false;
				in_tables_section = false;
				in_dimstyle_table = false;
				out.push_back(lines[i]); if (i+1 < lines.size()) out.push_back(lines[i+1]); i += 2; continue;
			}

			// Detect TABLE/DIMSTYLE start and end inside TABLES section
			if (in_tables_section && code == "0" && trim(value) == "TABLE") {
				out.push_back(lines[i]); out.push_back(lines[i+1]); i += 2;
				// next group likely 2 DIMSTYLE
				if (i+1 < lines.size()) {
					string c2 = trim(lines[i]); string v2 = trim(lines[i+1]);
					out.push_back(lines[i]); out.push_back(lines[i+1]);
					i += 2;
					if (c2 == "2" && v2 == "DIMSTYLE") {
						in_dimstyle_table = true;
					}
				}
				continue;
			}
			if (in_dimstyle_table && code == "0" && trim(value) == "ENDTAB") {
				in_dimstyle_table = false;
				out.push_back(lines[i]); out.push_back(lines[i+1]); i += 2; continue;
			}

			// Remove per-entity dimvar overrides stored in 1002 "{...}" chunks.
			if (code == "1002") {
				string vtrim = trim(value);
				if (!vtrim.empty() && (vtrim.front() == '{' || vtrim == "{")) {
					// start skipping until matching 1002 with '}'
					skipping_1002_block = true;
					i += 2; // skip this opening pair
					continue;
				}
			}

			// In HEADER section: handle $DIMSCALE variable (group code 9 then 40)
			if (in_header_section && code == "9") {
				string varname = trim(value);
				// copy the 9 line and lookahead to next pair
				out.push_back(lines[i]);
				if (i+1 < lines.size()) {
					out.push_back(lines[i+1]);
				}
				i += 2;

				if (varname == "$DIMSCALE") {
					// next pair should be group code 40 with a value: we need to set it to 1.0
					if (i+1 < lines.size()) {
						string next_code = trim(lines[i]);
						// write modified value
						if (next_code == "40") {
							out.push_back(lines[i]); // code line
							out.push_back(string("1.0"));
							i += 2;
						} else {
							// not expected; just continue without modification
						}
					}
				}
				continue;
			}

			// In DIMSTYLE table records, set DIMLFAC (group code 144) to 1.0
			if (in_dimstyle_table) {
				if (code == "144") {
					// replace value with 1.0
					out.push_back(lines[i]); // code line (144)
					out.push_back(string("1.0"));
					i += 2; continue;
				}
			}

			// Default: copy the pair as-is
			out.push_back(lines[i]);
			if (i+1 < lines.size()) out.push_back(lines[i+1]);
			i += 2;
		}

		// Write output
		ofstream fout(outpath);
		if (!fout) { cerr << "Failed to open output: " << outpath << '\n'; return 3; }
		for (auto &s : out) fout << s << '\n';
		fout.close();

		cerr << "Done. Wrote: " << outpath << '\n';
		return 0;
	}
	
Thanks

Post Reply

Return to “QCAD Community Edition”