We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Newbie > Picture in Interface > how to use png file?

stefan
Advisor
I try to decipher how to use a basic PNG image in my user Interface, but can't seem to get it working.

I read about saving a picture inside ArchiCAD as a GSM object, to embed it into the library object.
I also read about using an index to refer to the picture that is embedded.

But I want to use an external image (if possible). It is stored inside the library folder for this project.

! interface script
UI_PICT "arch.png", 0, 0, 320, 240, 1
Nothing is seen in the preview, nor in the saved Library object. Any hints?

This works using the preview image

! interface script
UI_PICT 0, 0, 0, 320, 240, 1
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad28/Revit2024/Rhino8/Solibri/Zoom
MBP2023:14"M2MAX/Sequoia+Win11
Archicad-user since 1998
my Archicad Book
4 REPLIES 4
Anonymous
Not applicable
Load "arch.png" into the Embedded Library and it will be visible in Object Interface Dialog.
stefan
Advisor
I got it to work, but still doubt how I succeeded.

I placed the images in a Project Library that I'm working on. Reloaded a few times. When developing the script, nothing was visible in the GDL editor.

Is the GDL editor accessing the currently loaded Libraries from the open ArchiCAD session?

I noticed that it worked without file extension.
! UI_PICT picture_reference, x, y [, width, height, alpha (0/1)+ratio(0,2,4)
sX = 396
sY = 462
s = 0.5

if (SB_style = "Romaans") THEN pict = "arches-roman"
if (SB_style = "Gotisch") THEN pict = "arches-gothic"
if (SB_style = "Lancet")  THEN pict = "arches-lancet"
UI_PICT pict, 10, 10, sX*s,sY*s, 1
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad28/Revit2024/Rhino8/Solibri/Zoom
MBP2023:14"M2MAX/Sequoia+Win11
Archicad-user since 1998
my Archicad Book
Anonymous
Not applicable
Hello Stefan,

Strange...should work fine with the file extension and with an external library.

ui_pict "Great.png", 10, 10, 252, 171, 1
Anonymous
Not applicable
Actually, the script is running and without. But I had a bug when the picture was gone when I added the expansion picture restored. Since then, I always write an extension. It is possible that in the loaded libraries already have the elements with this name - a duplicate, but different extensions.