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

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10
2 REPLIES 2

Matthew Lohden
Newcomer
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.
Matthew Lohden
Consultant, SF CA

MacPro 8core 32GB Radeon 5870
OSX 10.8 Mountain Lion, XP32, Win 7x64

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Didn't find the answer? Start a new discussion

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!