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

Passing values back from called macros back to parent object

Barry Kelly
Moderator
I'm looking for a way to have a called macro calculate a value for a string parameter and then pass that value back to the parent object.

Up till now I have always used a GLOB_USER variable.
The macro sets the GLOB_USER and the the object reads that value.

But there seems to be a bug in 12 that does not recognize a text string GLOB_USER value when the object is viewed in 3D. (I have reported this bug to Graphisoft).

2D is fine but 3D doesn't seem to work.

PUT and GET works great for numerical values but not for string values.


So I am looking for a way to get a string value calculated in a macro to be available for use in the parent object.
Any ideas please let me know.


For those interested in trying a simple experiment to prove my point (and I hope I am not making a complete fool out of myself ).

Create a new object.
In the master script write -

GLOB_USER_17 = "xyz"

In the 2D script write -
PRINT GLOB_USER_17

In the 3D script write -
PRINT GLOB_USER_17

Now view the 2D and a message will appear showing "xyz".
The same will happen when you view the 3D view.


Now create another new object.
Nothing in the master script.

In the 2D script write -
PRINT GLOB_USER_17

In the 3D script write -
PRINT GLOB_USER_17

Now view the 2D and a message will appear showing "xyz".

Open the 3D view and the message window will be blank (I hope otherwise I am going mad).

It all works fine in previous versions.

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
2 REPLIES 2
Anonymous
Not applicable
Take a look at the GDL Reference under the CALL function and specifically the RETURNED PARAMETERS keyword (pgs 222-223). You can return whatever you want to the calling macro.
Barry Kelly
Moderator
Matthew wrote:
Take a look at the GDL Reference under the CALL function and specifically the RETURNED PARAMETERS keyword (pgs 222-223). You can return whatever you want to the calling macro.
Thanks Matthew,
I hadn't noticed that one.

After a quick look at it there appears to be one small problem though.
It does not appear to be live.
For example object A calls object B which does a calculation based on the rotation angle of object A.

If object A rotation = 0 then orient = "E"
If object A rotation = 90 then orient = "N"
If object A rotation = 180 then orient = "W"
If object A rotation = 270 then orient = "S"

The RETURNED_PARAMETER orient is set in object A which is good.
However if you rotate object A on screen (2D or 3D) the parameter does not alter even after a rebuild and regenerate.
You physically have to select the object (inividually if there is more than one) and open the object settings before the new orientaion is re-set.

I have zipped up a couple of very simple objects to show what I mean.
Load both in your library and place object A and rotate it to see what I mean.

And this is pretty much exactly the issue I am having.
All my doors and windows are calling a macro that sorts out the orientation of the frame.
I was sending this to a GLOB_USER variable but that seems not to work in 12 which is why I am looking for an alternate solution.
The RETURNED_PARAMETER is close to what I need but there would be problems if people simply rotate walls with frames in.

I will keep searching for a solution.
Thanks for your help.
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

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!