cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.
SOLVED!

Sending a value from 3D Script to parameter

Durval
Advocate

I’m creating a custom object that is made up of a certain number of elements. This quantity is calculated inside the 3D script using a WHILE…ENDWHILE loop. Inside this loop, I have a counter variable that is incremented by 1 each time the loop runs, so at the end I know how many elements were generated. What I would like to do is expose this quantity to the user by writing it into a parameter.

 

However, since the Parameter Script runs before the 3D script, the counter value is not yet available there. The PARAMETERS command in the Parameter Script gives me an “uninitialized variable” error message.

 

What is the recommended workflow if you want to expose a value to the user that depends on calculations normally done in the 3D script, without duplicating all the same loops and calculations in the Master Script?

 

Operating system used: Mac Apple Silicon Sequoia

--- www.dtabach.com.br ---

AC 27/28 BRA – MacBook Pro Apple M2 16GB RAM Mac OS Sonoma
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator

@Durval wrote:

What is the recommended workflow if you want to expose a value to the user that depends on calculations normally done in the 3D script, without duplicating all the same loops and calculations in the Master Script?


You will need to do the calculations in the master script.

So you will need the While/Endwhile in the master script that does just the count, and another While/Endwhile in the 3D that does just the elements but not the count.

 

Any calculations done in the master script are available to all scripts, so you could also use it for the 2D.

 

Or you can actually place the 3D elements in the master script as well and have nothing in the 3D script.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

2 REPLIES 2
Solution
Barry Kelly
Moderator

@Durval wrote:

What is the recommended workflow if you want to expose a value to the user that depends on calculations normally done in the 3D script, without duplicating all the same loops and calculations in the Master Script?


You will need to do the calculations in the master script.

So you will need the While/Endwhile in the master script that does just the count, and another While/Endwhile in the 3D that does just the elements but not the count.

 

Any calculations done in the master script are available to all scripts, so you could also use it for the 2D.

 

Or you can actually place the 3D elements in the master script as well and have nothing in the 3D script.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru

If you decide to put 3D elements in the Master Script, add a GLOB_VIEW_TYPE or what ever the command that superseded it was to limit when it is run.

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

Setup info provided by author