GDL
About building parametric objects with GDL.

GLOB_SUN_AZIMUTH shows default value

greg_lupo
Booster
Hi,
I would like to read GLOB_SUN_AZIMUTH value and put it to array parameter then change sun position and again add new value to an array. Master script looks like this

if glob_ui_button_id = UI_SET then 
count = vardim1(list)

 list[count+1] = GLOB_SUN_AZIMUTH 
parameters list = list 
endif 
When ui_button (with id = UI_SET) is pressed only default value (240) is placed in "list" array but when use e.i

rotz GLOB_SUN_AZIMUTH
block 1,1,1
rotation is ok.
Why current value is not passed?
8 REPLIES 8
http://gdl.graphisoft.com/reference-guide/fly-through-information

Does not work in Parameter script...only 2-3D and UI.

Piotr
Peter Baksa
Graphisoft
Graphisoft
The camera tool can store different sun positions, and GLOB_SUN_AZIMUTH will be updated when rendering the animation path.
Are you trying to do something different?
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
greg_lupo
Booster
Piotr wrote:
http://gdl.graphisoft.com/reference-guide/fly-through-information

Does not work in Parameter script...only 2-3D and UI.

Piotr
Yes I know that. script was put into Master.
greg_lupo
Booster
Peter wrote:
The camera tool can store different sun positions, and GLOB_SUN_AZIMUTH will be updated when rendering the animation path.
Are you trying to do something different?
Yes I want to make an object that stores several sun postions and draws 2D symbol with cpecific rays.
In 3D it supose to produce 3D rays. Then I want to use it in Grasshopper where rays will be converted to vectors which will be put in a middle of selected windows. Rays will have "infinite" length so I want to use them to find collisions with surrounding buildings.
runxel
Legend
greg_lupo wrote:
Yes I know that. script was put into Master.
That actually doesn't matter.
The master script in GDL is kind of a "global" script in that way, that you can put any command there, it will mostly executed in the right context.
This also means, your script won't work.
What you want to achieve is not possible, the user will have to input the sun positions manually, if you want to have them all at once.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | 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»
greg_lupo
Booster
runxel wrote:
greg_lupo wrote:
Yes I know that. script was put into Master.
That actually doesn't matter.
The master script in GDL is kind of a "global" script in that way, that you can put any command there, it will mostly executed in the right context.
This also means, your script won't work.
What you want to achieve is not possible, the user will have to input the sun positions manually, if you want to have them all at once.
I understand. hmm pity. Now it works manually. user rotate hotspot2 in actual azimuth position of sun and drag hotspot in 3d to get actual Altitude. Then in UI can add this two values to array.
I hoped I could avoid using hotspots.
Peter Baksa
Graphisoft
Graphisoft
Hi greg_lupo,

Maybe you can skip using hotspots and set up the sun position on the UI.

ui_outfield GLOB_SUN_AZIMUTH, 0, 0, 100, 20

will show the current value on the UI, give an infield next to it where the user can repeat it as input. I know its lame but the closest workaround we have.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
greg_lupo
Booster
Yes, looks simpler than moving hotspots. Will try that.