SOLVED!
Always readable text when rotated 270 degrees
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-15 01:36 PM
2019-03-15
01:36 PM
The text is just not displayed correctly when the object is rotated 270 degrees, even though in the screen shot from the tutorial, it seems to work. What is displayed in my case, is a text rotation for 180 degrees, not 270.
Here is the code / tutorial I used:
Am I doing something wrong?
(Trying to get this work in Archicad 20/22 SWE)
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-22 02:18 AM
2019-03-22
02:18 AM
mbl wrote:When you rotate an element by say 90° it should in theory be exactly 90°.
But it is still unclear to me what does it do in the "if" statement. Why would I need to add a 1/10000 degree rotation in that "if" condition?
But in reality it might be 90.000012° - either because of bad user input or rounding errors internally in the program (I think they call it floating point errors?).
So the EPS value is a way of checking for rounding errors.
The smaller the value for EPS the more accurate it will be - but you don't want it too small that it doesn't filter small rotation errors.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
5 REPLIES 5
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-20 08:13 PM
2019-03-20
08:13 PM
Any ideas? Anyone?
After playing with the code a little bit, I found out that the object totally ignores the "readable" part of the script.
This was the original part of the script:
if iTypeTextRotation = 2 then ! Readable
if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
rot2 180
_nTrans = _nTrans + 1
endif
And when I took away the "EPS" from the conditions, the object seems to work as it should.
Okay, but then what does the "EPS" do in the script? Other than making it dysfunctional...
Maybe someone more experienced can answer? Or maybe someone from Graphisoft can explain what's going on?
As someone new to the GDL, it can be very frustrating that there is very little help online on the topic and even when there is, it seems to give misleading solutions.
After playing with the code a little bit, I found out that the object totally ignores the "readable" part of the script.
This was the original part of the script:
if iTypeTextRotation = 2 then ! Readable
if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
rot2 180
_nTrans = _nTrans + 1
endif
And when I took away the "EPS" from the conditions, the object seems to work as it should.
Okay, but then what does the "EPS" do in the script? Other than making it dysfunctional...
Maybe someone more experienced can answer? Or maybe someone from Graphisoft can explain what's going on?
As someone new to the GDL, it can be very frustrating that there is very little help online on the topic and even when there is, it seems to give misleading solutions.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-20 10:06 PM
2019-03-20
10:06 PM
Did you download the example code via the link? You will find in the Master script the definition:
EPS = 0.0001
This is used when comparing real numbers as in the equation in the 2D script:
if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
I agree GDL is not easy to learn, but the best way to start is with the old GDL Cookbook by David Nicholson-Cole (PDF available on internet). It is old but still useful for learning the basics.
EPS = 0.0001
This is used when comparing real numbers as in the equation in the 2D script:
if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
I agree GDL is not easy to learn, but the best way to start is with the old GDL Cookbook by David Nicholson-Cole (PDF available on internet). It is old but still useful for learning the basics.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-21 11:49 AM
2019-03-21
11:49 AM
Thanks Graeme. No, I didn't download the files at first. I started with copying the code and defining parameters in my own object. And since there was no mention of any "EPS" variable in the tutorial, I have obviously missed it.
I can see where it is used, that's where I've deleted it from to make my original code function. But it is still unclear to me what does it do in the "if" statement. Why would I need to add a 1/10000 degree rotation in that "if" condition?
I can see where it is used, that's where I've deleted it from to make my original code function. But it is still unclear to me what does it do in the "if" statement. Why would I need to add a 1/10000 degree rotation in that "if" condition?
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-22 02:18 AM
2019-03-22
02:18 AM
mbl wrote:When you rotate an element by say 90° it should in theory be exactly 90°.
But it is still unclear to me what does it do in the "if" statement. Why would I need to add a 1/10000 degree rotation in that "if" condition?
But in reality it might be 90.000012° - either because of bad user input or rounding errors internally in the program (I think they call it floating point errors?).
So the EPS value is a way of checking for rounding errors.
The smaller the value for EPS the more accurate it will be - but you don't want it too small that it doesn't filter small rotation errors.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2019-03-22 12:20 PM
2019-03-22
12:20 PM
Thanks Barry, that makes sense.