GDL
About building parametric objects with GDL.

Send request result to parameter

greg_lupo
Booster

Hi,

Thermal_conductivity			= 0 
Density							= 0 
Heat_capacity					= 0 
Embodied_energy					= 0 
Embodied_carbon					= 0 

s 	=	REQUEST{2} ("Building_Material_info", 1, 'gs_bmat_physical_properties', Thermal_conductivity,Density,Heat_capacity,Embodied_energy,Embodied_carbon)

param_Thermal_conductivity = Thermal_conductivity
				 
parameters param_Thermal_conductivity = param_Thermal_conductivity

I would like to save result (Thermal_conductivity) of request command into parameter (param_Thermal_conductivity) but it sends zero. However Thermal_conductivity has a value that can be displayed ie in text2.

Is it possible to do so?

5 REPLIES 5
Lingwisyer
Guru

Yes. I am assuming that your code is in the Parameter Script? I have used the below in one object

 

Master

n2 = REQUEST ("Profile_default_boundingbox", myProfileIdx, _xMin, _yMin, _xMax, _yMax)

 

Parameter

PARAMETERS ProWidth = abs(_xMax - _xMin)

 

Lingwisyer_0-1674196747887.png

Lingwisyer_1-1674196762269.png

 

 

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

I replicated Your examplle but its not working (AC26) although text2 (on a right) is showing retrieved value. Can You attach Your object?

req.png 

Thanks For example.
I analised it and figureout that Your object doesnt pass value to parameter neither 😞

What You showed in previuos post was value displayed in  UI. and in UI script you use again request  command just to displlay value in UI. but when You look into parameters ProWidth parameter (keep this example) is 0

 

It pass a value only when profile is square/circle and desnt require request command

(I exposed ProWidth parameter that was named 'Width')

square.png

 but when compllex profile is used it passes 0

compllex.png

   

Lingwisyer
Guru

Oh... I never noticed as I used the requested values to get a consistant profile position, display the values in the UI then forgot about it. Bit odd that it does not seem to work as using the requested values seems to works fine in every other situation...


Expression returns 0 and contains dummy return values (emtpy string or 0) if used in parameter script, causing additional warning.

 

Both our requests have that note under them... wonder what the issue is...

 

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

I have been wrestling with these issues recently. GDL appears to be quite selective about allowing parameters to update, I assume fairly, that this is to avoid creation of circular value settings e.g. a parameter in object A is referenced in object B and object B references object A. It may be that a REQUEST value is also considered Global and therefore there should be no need to display it as a Parameter. So all objects have to REQUEST the value from source.

 

If you need to see the values in the REQUEST then PRINT and TEXT2 can be useful temporary checks.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)