2023-12-12 05:31 PM - last edited on 2024-09-26 01:30 PM by Doreena Deng
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 ?
2023-12-13 02:55 AM
@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.
2024-01-08 11:42 AM
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.