cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

How can I pull in variables from another object

Anonymous
Not applicable
Can any one please show by example the simplest way if one How I can display a "called" object's variable values in the Parameters window.

I am trying to set up a railing object in which I am making a call on spindles and railings and I would like to have the option to use the called objects values or input my own values. Any suggestions or ideas would greatly be appreciated.
22 REPLIES 22
Anonymous
Not applicable
This is only a pointer to help you find a solution. The CALL stmt includes and option for RETURNED_PARAMETERS rparam1, rparam2, rparam3, ... which I think should get them up into the CALLing routine for inspection. PRINT doesn't work in the Parameter script, (?!) so Andrew Watson's suggestion (GDL Handbook) is to use the OUTPUT stmt to get data into something else that you can print.

In some cases we have succeeded in moving some code from the Parameter script to the 3D script just in order to use the PRINT capability there.

Also, with Reporting set to Full Report in preferences of your work environment, we have been able to get array output and tests of VALUE lists displayed in the Reports window. Hope that helps.
Anonymous
Not applicable
If I read you correctly you want to be able to use the internal values of the spindles or override them with the parameters from the railing script. This is most easily done by just choosing between two CALL statements with an IF/THEN/ELSE condition, such as:
IF use_default_spindle THEN
    CALL spindle_GDL
ELSE
    CALL spindle_GDL PARAMETERS spindle_sz = spindle_sz !!!and so on...
ENDIF
If you really need to know and display the internal defaults of the spindle macro you can use the RETURNED_PARAMETERS function as Didrik suggests.

If you want to apply these values to the user parameters in the railing you may be able to use the PARAMETERS statement for this but there may be execution order issues.
Anonymous
Not applicable
Thanks for the post. I will try the suggestions out within the next break I have. Can't wait to try them out.
Anonymous
Not applicable
Here is more information that may help with what I need to solve this problem.
1. I am calling railing and spindles separately.
2. when I am using the default sizing it is important to know the values because the spindle spacing is calculated from the width of the spindle. Same for the railing depth. Its value is needed for the final height of the spindles.
I can make a simple call and the object is what is should be but without knowing what the called object dimensions are the script can not complete the calculations correctly.
Anonymous
Not applicable
hhd801 wrote:
2. when I am using the default sizing it is important to know the values because the spindle spacing is calculated from the width of the spindle.
For this use the RETURNED_PARAMETERS function as Didrik suggests.
Anonymous
Not applicable
CALL TrimPro,
PARAMETERS A=Cus_Trim_WID, B=-trim_length, zzyzx=Cus_Trim_HGT,
RETURNED_PARAMETERS Trim_A, TRIM_B, TRIM_C

I cannot seem to get this to work. After Returned_Parameters I create the above values. I then Put these same values in the Main parameters interface. Does anyone know what I am missing. I tried reading The GDL Handbook which was worthless to me because it read just like ArchiCad's GDL Reference Guide. GDL Cookbook was the best.
Did You use END command in the called object with values You need to get after the "end" in the proper script?
Refer to the END command description in GDL manual

Best Regards,
Piotr
Anonymous
Not applicable
It is nested within a subroutine with a end after all the GoSub commands. Is this what you are referring to?
Depends what is the object structure - especially the place where the calculation take place.

if it is in parameters script and if You have subroutines than You have end command already - so place the names of the varaibles to be passed to the caller object - names do not matter but the position matter.

the RETURNED_PARAMETERS val1, val2 .... gets the values by position not name in END command in called object.

Best Regards,
Piotr