cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

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

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

UI_CUSTOM_POPUP_INFIELD

GDL Enthusiast
Enthusiast

Hi GDL experts,

 

I have been reading about UI_CUSTOM_POPUP_INFIELD. I can get it to work in the Interface, however I am wondering how I can feed the result back to a parameter. For example:

 

Interface Script:

UI_CUSTOM_POPUP_INFIELD "MyParameter", 15, 70, 180, 20,
1, 2, 2, "", ! storeHiddenId, treeDepth, groupingMethod, selectedValDescription
"hiddenID1", "type1", "group1",
"hiddenID2", "type1", "group1",
"hiddenID3", "type1", "group1"

 

Then if I create a parameter called "MyParameter" (Type: Abc), can I then reference the parameter with an IF statement in the Master Script:

 

Master Script:

IF MyParameter=hiddenID1 THEN
Text2 0,0, "Type 1, Group 1"
ENDIF

 

At the moment the above doesn't seem to work. I would welcome any help, thank you so much in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Zsuzsanna Bori
Graphisoft
Graphisoft

Hi,

In the master script when referencing string type parameters, you have to use “ “ as well. The other issue here is in the interface script, the array you have defined contains duplicates, all of the entries are the same “type1”, “group1”, you have to have a different combination for all the hiddenIDs in order for your array to work. Your working code should look like this:

UI_CUSTOM_POPUP_INFIELD "MyParameter", 15, 70, 180, 20,

1, 2, 2, "", ! storeHiddenId, treeDepth, groupingMethod, selectedValDescription

"hiddenID1", "type1", "group1",

"hiddenID2", "type1", "group2",

"hiddenID3", "type1", "group3"

 

Master script:

IF MyParameter = "hiddenID1" THEN

Text2 0,0, "Type 1, Group 1"

ENDIF

View solution in original post

2 REPLIES 2
Solution
Zsuzsanna Bori
Graphisoft
Graphisoft

Hi,

In the master script when referencing string type parameters, you have to use “ “ as well. The other issue here is in the interface script, the array you have defined contains duplicates, all of the entries are the same “type1”, “group1”, you have to have a different combination for all the hiddenIDs in order for your array to work. Your working code should look like this:

UI_CUSTOM_POPUP_INFIELD "MyParameter", 15, 70, 180, 20,

1, 2, 2, "", ! storeHiddenId, treeDepth, groupingMethod, selectedValDescription

"hiddenID1", "type1", "group1",

"hiddenID2", "type1", "group2",

"hiddenID3", "type1", "group3"

 

Master script:

IF MyParameter = "hiddenID1" THEN

Text2 0,0, "Type 1, Group 1"

ENDIF

GDL Enthusiast
Enthusiast

Hi Zsuzsanna,

 

That is so great, thank you for helping me progress this through, really appreciated!!!

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!