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.

Can PARAMETERS update a variable change coming from the 2D/3D scripts ?

MetalFingerz
Advocate

Hello,

I have an object that has different modules and each could have a different finish from each other and I'd like to schedule this. There are 4 finishes so I have 4 parameters that are integers so I can have the total for each (for easier scheduling)

 

At first, because the finishes were 3D only, I defined variables in the main script, (tried to) increment them in the 3D script (after each assignment) then wanted to PARAMETERS the total numbers in the parameter script. This didn't work as the variable always kept the default value as if it was passing over my 3D script code.

 

So I ended up doing all the work and increments in the main script and then using PARAMETERS in the parameter script to update the totals which worked. Now all info is calculated beforehand but I'm not really satisfied as my main script now holds info and calculations that are only used by my 3D script.

 

Am I doing something wrong or is this normal behavior ?

2 REPLIES 2
Barry Kelly
Moderator

@MetalFingerz wrote:

Now all info is calculated beforehand but I'm not really satisfied as my main script now holds info and calculations that are only used by my 3D script.


That is the perfect place for any calculations.

The master script (and parameter script) is run before the 2D and 3D scripts are run, so calculations done in the master can be used anywhere.

 

You can not set parameter values from the 2D or 3D script, and any calculations you do in one can not be used in the other as they don't talk to each other.

The 3D script will only be run when you view the object in 3D or open the settings and preview the 3D view.

The same applies to the 2D - although you see it in the plan you may have to re-build & regenerate the plan to update any changes.

 

The master script is run all of the time, just refreshing the screen should be enough to run it, so all the calculations will be up to date.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Peter Baksa
Graphisoft
Graphisoft

You can use GLOB_SCRIPT_TYPE to skip some calculations in the master script. It contains the script ID that will be run after the master script.

 

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!