GDL
About building parametric objects with GDL.

GDL - get value before parameter change

Darwuhr
Enthusiast

If I change the vakue of a paramter, either via objects settings dialog or editable hotspot, can I get the value of the parameter before the change? Example I change the parameter x1 via editable hotspot. I want to store the value of x1 before the change so I can do some extra needed calculations. So I will have the x1 param with the new value and another param that will have the value of x1 before the change.

3 REPLIES 3
runxel
Legend

Use a shadow parameter for that.

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Could you explain what a shadow parameter is and how to apply one?

It's called like that because you're shadowing one parameter to another, invisible one (for the user).

Just make two parameters for every parameter setting you'll need. One is hidden for the user ('X' it), the other one is the main input.

 

Pseudocode:

! ::Master or Param script::
if GLOB_MODPAR_NAME = "myparam" then
	! do your calculations
	...
	! finally mirror the current value to the shadow parameter:
	myshadowparam = myparam
endif

! … and set the parameter value
parameters 	myshadowparam = myshadowparam

 

 

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»