GDL
About building parametric objects with GDL.
SOLVED!

Need a UI_INFIELD{4} (method 4) Example?

Sofiane LPAF
Contributor

Hello everyone,

Can you please give me an example of a short script of the UI_INFIELD{4} command to create 3 or 4 "Push icon radio control" (method 4) using matching images

THANKS

Capture d’écran 2024-10-10 104838.png

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
MF BIM
Enthusiast

Hi @Sofiane LPAF ,

 

Assuming "abcde" is an integer type parameter...

In the Parameter script :

 

 

values "abcde" 1, 2, 3, 4

 

 

In the Interface script :

 

 

ui_dialog "Options", 520, 300

cell_width 	= 124
cell_height = 93
choices		= 4

ui_infield{4} "abcde", 5, 5, cell_width*choices+10, cell_height+10,	! coordinates, dimensions
				4, "xy3.png",										! method, picture
				choices, 4,											! pictures, rows
				cell_width, cell_height, cell_width, cell_height,	! cell, pic dimensions
				1, "", 1,
				2, "", 2,
				3, "", 3,
				4, "", 4

 

 

Attached, updated versions of your picture with some transparency so there the button behavior is still visible. xy2.png has 0 white background while xy3 keeps the white background within the contours.


xy3.pngxy2.png

 

ui_with_xy3.pngui_with_xy2.png

https://mfbim.fr | https://youtube.com/@mfbim | https://bsky.app/profile/mfbim.fr
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro

View solution in original post

3 REPLIES 3
Solution
MF BIM
Enthusiast

Hi @Sofiane LPAF ,

 

Assuming "abcde" is an integer type parameter...

In the Parameter script :

 

 

values "abcde" 1, 2, 3, 4

 

 

In the Interface script :

 

 

ui_dialog "Options", 520, 300

cell_width 	= 124
cell_height = 93
choices		= 4

ui_infield{4} "abcde", 5, 5, cell_width*choices+10, cell_height+10,	! coordinates, dimensions
				4, "xy3.png",										! method, picture
				choices, 4,											! pictures, rows
				cell_width, cell_height, cell_width, cell_height,	! cell, pic dimensions
				1, "", 1,
				2, "", 2,
				3, "", 3,
				4, "", 4

 

 

Attached, updated versions of your picture with some transparency so there the button behavior is still visible. xy2.png has 0 white background while xy3 keeps the white background within the contours.


xy3.pngxy2.png

 

ui_with_xy3.pngui_with_xy2.png

https://mfbim.fr | https://youtube.com/@mfbim | https://bsky.app/profile/mfbim.fr
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro

I thank you very much for your help, clear and precise, it works very well. Thank you once again for your time, see you next time!!!

SofianeLPAF_0-1728582384834.png

 

Good to know it worked ! If you can, please mark my previous post as solution so people see your question as solved if they look for the same answer 🙂

 

I would also advise to resize the pictures beforehand so they look cleaner in the UI. If the resizing is done with GDL in Archicad, the .pngs will look blurry.

https://mfbim.fr | https://youtube.com/@mfbim | https://bsky.app/profile/mfbim.fr
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro