GDL
About building parametric objects with GDL.
SOLVED!

Problem with storing GLOB_UI_BUTTON_ID

Domagoj Lukinic
Booster

Hi all, 

I have a problem in my interface script. 

I have a table that can have a range [0,10], in UI there is a UI_BUTTON (GLOB_UI_BUTTON_ID=11 and GLOB_UI_BUTTON_ID=12) that adds and subtracts a table by one (+ and - in the pic) there is also a UI_BUTTON with text "Simbol 1,2,3...10", (GLOB_UI_BUTTON_ID=j) when the UI_BUTTON is pressed you get a selection of symbols that you can choose, however the problem starts when you choose a symbol the infield disappears become GLOB_UI_BUTTON_ID becomes 0 i also have a specific text input field that shows specifically when some symbols are selected. My question is can I "force" AC to store the current value of GLOB_UI_BUTTON_ID?

 

picX=50
picY=50
for j = 1 to numberOfTabs
    if GLOB_UI_BUTTON_ID = j   then
        ui_infield{4} simbolSelectionPosText[j],330,0,350,uiDimY,
            1, "",
            7,
            2, picX+50, picY+70,
            picX, picY,
            simbolSelectionPosPic, simbolSelectionPosText, simbolSelectionPosIndex
    endif
next j

 

 


UI selection.png
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

This is the solution. But if you use a parameter to store this information its funnily even easier to have the buttons correspond to the parameter directly, like e.g. an ui_infield{3} with method = 4.

Either way it will work.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

5 REPLIES 5
NMK195
Participant

Hi,

I still don't understand your purpose for doing those things. If it's just to select the desired symbol type, why don't you create a "type" variable and use UI_INFIELD{4} to display the image for easier selection? If you have a different purpose, it's best to upload the object so it's easier to visualize.

NMK195_0-1747360993701.png

 

vlahtinen
Advocate

Could you create a parameter for the button id and update it in the parameter script whenever the GLOB_UI_BUTTON_ID is different from 0? Then use the parameter instead of GLOB_UI_BUTTON_ID in the ui script.

Solution

This is the solution. But if you use a parameter to store this information its funnily even easier to have the buttons correspond to the parameter directly, like e.g. an ui_infield{3} with method = 4.

Either way it will work.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Domagoj Lukinic
Booster

Hi all, 

thank you all for the suggestions, and yes this works.

I added a condition in parameter script:

if GLOB_UI_BUTTON_ID >= 1 and GLOB_UI_BUTTON_ID <= brojSimbola then
    parameters activeSimbol = GLOB_UI_BUTTON_ID
endif

and added a parameter activeSimbol int 1

and replaced the conditions inside the loop with that variable.

once again thank you all for the replay and suggestions.


 

BUTTON_ID kind of never worked as suposed (or better words as I imagined it should work),

The proper way to go is the UI_PICT_RADIOBUTTON/ UI_PICT_RADIOBUTTON{2} - it is with picture or text depending on if the picture is defined.

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!