GDL
About building parametric objects with GDL.

picture2{2} command. Is there a way to limit the libraries that the custom picture looks at?

KB-at-CWA
Booster

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

 

Image - Limit Selection.png

Graphisoft Certified Archicad BIM Manager - AC6 to AC25/AC26 macOS Ventura
2 REPLIES 2
Barry Kelly
Moderator

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.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Jochen Suehlo
Advisor

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
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de