The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Topics specific to the scripting and development of Library Parts and Libraries using Param-O or the Geometric Description Language – GDL. (Example: How do you use “REQUEST” GDL commands?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, Gordana Radonic, nbalogh, mnguyen, gkmethy, rmasaki, Akos Somorjai, Csilla Mai, Peter Baksa

By greg_lupo
#322371
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
Code: Select all
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
Code: Select all
rotz GLOB_SUN_AZIMUTH
block 1,1,1
rotation is ok.
Why current value is not passed?
#322460
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?
By greg_lupo
#322808
Peter Baksa wrote: Mon Feb 15, 2021 7:23 pm 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.
User avatar
By runxel
#322810
greg_lupo wrote: Tue Feb 23, 2021 4:28 pm 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.
By greg_lupo
#322811
runxel wrote: Tue Feb 23, 2021 4:52 pm
greg_lupo wrote: Tue Feb 23, 2021 4:28 pm 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.
#322984
Hi greg_lupo,

Maybe you can skip using hotspots and set up the sun position on the UI.
Code: Select all
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.