2023-12-13 02:31 AM - last edited on 2024-09-26 01:32 PM by Doreena Deng
I have created an object that calls an image to display in the 2D view. It works getting images into schedules.
However when you go and choose your custom picture the menu that opens lists every image that is loaded in the libraries. See image attached
Is there a way to limit the picture2{2} command in the Parameter script?
The object was scripted in Archicad 25
Thanks
2023-12-13 02:43 AM
You could create a VALUES list for the parameter where you can set particular image names to choose from.
I don't think you can pick and choose which loaded library or part of the library to choose the files from.
I could be wrong about that, I can't say I have tried to do it so have not gone looking for any command that can read the files in a particular folder.
Barry.
2023-12-13 12:35 PM
In this cases I am using a filter routine. I use image names with a special prefix, so I can filter the images which only contain the prefix in their names. Example Script:
! ---------------------------------------------------------------------- !
! --------------- C u s t o m p i c t u r e f i l e r e q u e s t
! ---------------------------------------------------------------------- !
IF GLOB_FEEDBACK_MODE = 0 THEN
dim stCustomPicFiles[]
bCustomPicFileExist = APPLICATION_QUERY ("LIBRARY_MANAGER", "USER_IMAGE_FILES", stCustomPicFiles)
p_num = VARDIM1(stCustomPicFiles)
DIM stCustomPicFiles_with_prefix[]
si = 1
int_num_prefix = STRLEN(str_prefix)
IF (str_prefix # " " AND str_prefix # "") THEN
FOR i = 1 TO p_num
IF STRSUB(stCustomPicFiles[i], 1, int_num_prefix) = str_prefix THEN
stCustomPicFiles_with_prefix[si] = stCustomPicFiles[i]
si = si + 1
ENDIF
NEXT i
ELSE
stCustomPicFiles_with_prefix = stCustomPicFiles
ENDIF
p_num = VARDIM1(stCustomPicFiles_with_prefix)
ENDIF
IF p_num > 0 THEN VALUES "str_bildwahl" stCustomPicFiles_with_prefix