GDL
About building parametric objects with GDL.

GLOB_WORLD_ORIGO_OFFSET always returns Zero

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

Tested with AC 23 and 24.
Lucas Becker | Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
1 ACCEPTED SOLUTION
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 26
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

runxel
Virtuoso
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 | Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«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 26
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), 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
Virtuoso
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 | Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!