BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.
SOLVED!

Reset Parameter to default based on specific parameter change

MichaelIserief
Contributor

I have an A/C object that I would like to have a flexible slab. when we change the size of the unit (say from 12kW to 20kW) I would like the slab to change to suit the default size and then be stretchable after that. my problem comes when you reset to a smaller size unit and it maintains the larger slab.

 

My thoughts are to somehow get it to update to a default value when the kW parameter is changed and then allow a range of inputs. on the next kW change it would reset to the appropriate value for that size and then allow the stretch again. 

 

I don't know if i am maybe attacking this in the wrong way but I have googled my heart out and am at a wits end

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
runxel
Legend

The magic comes with the global called GLOB_MODPAR_NAME. It gives you the name of the last user modified parameter.

You could use it like this:

if GLOB_MODPAR_NAME = "size" then
  if size = 12 then
    parameters A = 1.0
  endif
  if size = 20 then
    parameters A = 2.0
  endif
endif

This changes the dimensions ("A" being used as an example here) once. It is still fully stretchable and only changes again when you update the kWh unit size.

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»

View solution in original post

2 REPLIES 2
Solution
runxel
Legend

The magic comes with the global called GLOB_MODPAR_NAME. It gives you the name of the last user modified parameter.

You could use it like this:

if GLOB_MODPAR_NAME = "size" then
  if size = 12 then
    parameters A = 1.0
  endif
  if size = 20 then
    parameters A = 2.0
  endif
endif

This changes the dimensions ("A" being used as an example here) once. It is still fully stretchable and only changes again when you update the kWh unit size.

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»

I have seen that command before but never quite fully understood it. Thanks for your help it worked a treat 😄

Learn and get certified!