BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
GDL
About building parametric objects with GDL.
SOLVED!

Passing Weblinks between values{2} list and Interface

GDL Enthusiast
Enthusiast

Hi, 

 

I would like to provide interface weblinks that change based on a values{2} list i.e.,

 

values{2} "WbLnk",  0, `www.google.com:`,

                    1, `www.youtube.com:`,

                    2, `www.facebook.com:`

 

UI_PICT_BUTTON UI_LINK, "", "Icon", 250, 100, 18, 18, 0, "WbLnk"

 

But that doesn't work...

 

My messy solution has multiple IF THEN statements in the interface script, each with their own weblink and text i.e.

 

IF WbLnk = 0 THEN     gosub "LinkA"

IF WbLnk = 1 THEN     gosub "LinkA"

! and so on...

 

end

 

"LinkA":
UI_PICT_BUTTON UI_LINK, "", "Weblink_Icon", 250, 100, 18, 18, 0, "www.google.com"
return


! and so on...

 

Is there a way to have UI_OUTFIELD and UI_PICT_BUTTON UI_LINK fed "www" address info from the values{2} list? 

 

Many thanks, Matt

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
A_ Smith
Expert

Because you are inserting WbLnk value, which is INTEGER. Just change in Parameters tab it to STRING (Abc) type and of course in Parameter script change values{2} to simply values

AC 22, 24 | Win 10

View solution in original post

4 REPLIES 4
Solution
A_ Smith
Expert

Because you are inserting WbLnk value, which is INTEGER. Just change in Parameters tab it to STRING (Abc) type and of course in Parameter script change values{2} to simply values

AC 22, 24 | Win 10

Thank you so much, that solves it! Most appreciated A_Smith!

Peter Baksa
Graphisoft
Graphisoft

You can also do it with parvalue_description if using values{2}.

 

 

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
GDL Enthusiast
Enthusiast

That is a new peice of code for me, thank you Peter for introducing me to it!

 

Many thanks, Matt

Learn and get certified!

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!