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

Number or Text Result in Macro

GDL Enthusiast
Participant
Hi GDL Experts,

My goal is to have the user change the parent object, using drop down value lists, that select various subroutines from the child object.


In the child object, I use the values{2} code to create values lists. From the values lists, I use IF __ THEN __ ENDIF statements to select subroutines based on what the user selects from the dropdown value list.


When I CALL an object using the CALL code, with a PARAMETER of the VALUES{2} of the child object, it only accepts a numerical number as a driver. e.g.

Standard code in parent object:

CALL "child" PARAMETERS TypeFromChild=1

Question:
Is it possible to use a VALUES{2} list in the child and then, copy and paste the same VALUES{2} list into the parent? Then to drive the CALL code with a PARAMETER of the VALUES{2} from the parent? E.g.

Ideal code in parent object:

PARAMETER TypeToCallFromChild=TypeFromParent
CALL "child" PARAMETERS TypeFromChild=TypeToCallFromChild


Thank you so much!
1 ACCEPTED SOLUTION

Solution
if the child object (typical referred to as macro) is not a placeable object then there is no need to create a dropdown menu for it. Instead this all should be done in the parent. Hence you need to ensure you have the same parameter(s) in the parent object. If you haven't added the parameter to the parent then it wont be able to be defined as a string, hence your numeric issue.

The parent is the controller and the child is just called to produce the results. This sentence sounds like slave labor, so I suggest you use the terms "main" (not "master" because a masterGDL object is a specific type) and "macro"

Macros (child objects) rarely need much of a parameter script as the user access of the parameters comes from the main (parent) object which the user places. If both main and macro are placeable then you have to set the values{2} in both.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

View solution in original post

3 REPLIES 3

Solution
if the child object (typical referred to as macro) is not a placeable object then there is no need to create a dropdown menu for it. Instead this all should be done in the parent. Hence you need to ensure you have the same parameter(s) in the parent object. If you haven't added the parameter to the parent then it wont be able to be defined as a string, hence your numeric issue.

The parent is the controller and the child is just called to produce the results. This sentence sounds like slave labor, so I suggest you use the terms "main" (not "master" because a masterGDL object is a specific type) and "macro"

Macros (child objects) rarely need much of a parameter script as the user access of the parameters comes from the main (parent) object which the user places. If both main and macro are placeable then you have to set the values{2} in both.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

View solution in original post

GDL Enthusiast
Participant
Hi Kirstian,

Thank you so much - you are so knowledgeable. I just tried it now and it works - so much fun! I will now try figure out the next step of the code

All the best!

You are welcome, and yes GDL definitely is fun.
Welcome to Archicad Talk also, you will find a lot of knowledgeable people here for everything Archicad related.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!