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

GDL
About building parametric objects with GDL.

Can the end-use manually search for a textile using a file-browsing dialog?

Jeroen
Booster

Hi!

I found this DIALOG option in the GDL Reference. Is this something so the user can manually search for a text file?

Jeroen_0-1705418982660.png
thanks a lot in advance!
Jeroen

 

6 REPLIES 6
Lingwisyer
Guru

Cannot help you, but just clarifying, when you say "manually search for a text file" you mean if the user does not know the name of a file, is there a way to access a file browser?

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

Hi Lingwisyer,
That is correct, can the user open the object and click on something so the file-browser appears and he can select a file from the computer,

thanks!
Jeroen

Jochen Suehlo
Moderator

Yes, Jeroen there appears a file browser. I used this in the past in some objects, but it does not work optimal.
E.G. When you have an object with this keyword and the linked text file is missing, the file-browser-dialog appears every time you open the file. Today I mostly use the LIBRARY keyword instead.
There is another way to use a filebrowser in GDL: The Filemanager I/O Addon.

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

Hi Joachim,

Thanks!
Do you have a code snippet of this Filemanager GDL. I'm having a hard time reading the manual,

Thanks in advance!
with kind regards,
Jeroen

Jochen Suehlo
Moderator
MASTER-SCRIPT

DIM bitmap[]

folder= OPEN ("FileMan", verz, "FILES, DIALOG")
linecont=1
n = INPUT (folder, 0, 0, datName)
WHILE n=1 DO
bitmap[linecont]=datName
linecont=linecont+1
n = INPUT (folder, 0, 0, datName)
ENDWHILE
CLOSE folder

!PARAMETER-SCRIPT
VALUES "filename" bitmap


The script shown stores the file names read from a directory selected via DIALOG in the "bitmap" array in the master script.
The WHILE loop searches for files until n=0 (i.e. no more files are found).
In the parameter script, the array transfers the values to a value list of a text parameter to be defined with the designation "filename".
With this script you have access to any files that you want to place as a bitmap texture on an image object, for example.
The "verz" parameter must also be created as a text type so that its change gives you access to the selection dialog box for the folders.

From: https://www.selfgdl.de/addons/filemanager-io/input-3/

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

Thanks a lot!!