Passing values back from called macros back to parent object

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2008-08-15
11:05 AM
- last edited on
‎2023-05-24
12:00 PM
by
Rubia Torres
‎2008-08-15
11:05 AM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2008-08-15 09:07 PM
‎2008-08-15
09:07 PM
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2008-08-19 06:30 AM
‎2008-08-19
06:30 AM
Matthew wrote:Thanks Matthew,
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.
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
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