We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.
SOLVED!

GLOB_WORLD_ORIGO_OFFSET always returns Zero

runxel
Legend
Hey there, found another bug:
GLOB_WORLD_ORIGO_OFFSET_X (and _Y) always return 0 (zero).

Tested with AC 23 and 24.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Peter Baksa
Graphisoft
Graphisoft
I couldn't reproduce that in AC24 build 3022.
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

View solution in original post

5 REPLIES 5
Barry Kelly
Moderator
runxel wrote:
Hey there, found another bug:
GLOB_WORLD_ORIGO_OFFSET_X (and _Y) always return 0 (zero).

Tested with AC 23 and 24.

Where are you using it?
It doesn't work in Parameter (Master) script.


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
runxel
Legend
Hey Barry, I know. I'm using it in the 2D script.
There is even an example code in the reference manual:
add2 -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_X, -GLOB_WORLD_ORIGO_OFFSET_X-SYMB_POS_Y
line2 -0.1, 0.0, 0.1, 0.0
LINE2 0.0, -0.1, 0.0, 0.1
hotspot2 0.0, 0.0, 1
text2 0, 0, "( 0.00 ; 0.00 )"
text2 0, 0.5, "World Origin"
del top

if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
   ! THIS WILL NEVER BE EXECUTED
    add2 - SYMB_POS_X, - SYMB_POS_Y
    line2 -0.1, 0.0, 0.1, 0.0
    line2 0.0, -0.1, 0.0, 0.1
    hotspot2 0.0, 0.0, 2
    text2 0, 0, "(" + str(GLOB_WORLD_ORIGO_OFFSET_X, 9, 4) + "; " + str(GLOB_WORLD_ORIGO_OFFSET_Y, 9, 4) + " )"
    text2 0, 0.5, "Virtual Origin"
    del top
endif

if abs(GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y) > 0.01 then
    line2 -0.1, 0.0, 0.1, 0.0
    line2 0.0, -0.1, 0.0, 0.1
    hotspot2 0.0, 0.0, 3
    text2 0, 0, "(" + str(GLOB_WORLD_ORIGO_OFFSET_X + SYMB_POS_X, 9, 4) + "; " + str(GLOB_WORLD_ORIGO_OFFSET_Y + SYMB_POS_Y, 9, 4) + " )"
    text2 0, 0.5, "Object Placement"
endif
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Barry Kelly
Moderator
I found that ....
if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or\
    abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
needs to be ...
if abs(GLOB_WORLD_ORIGO_OFFSET_X) > 0.01 or abs(GLOB_WORLD_ORIGO_OFFSET_Y) > 0.01 then
All on one line and the "/" removed after the OR


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
Solution
Peter Baksa
Graphisoft
Graphisoft
I couldn't reproduce that in AC24 build 3022.
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
runxel
Legend
Peter wrote:
This offset is only recalculated when a file is opened, so it might look it isn't working with a moved object.
First move the object far away from the origin, save the file, re-open it, and the extra hotspot will be visible.
THAT was the missing piece of information...
Sorry for the confusion and thanks to Péter!

It becomes quite obvious when you think about it, but man, sometimes the easiest things are the hardest.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»