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

list of images

Anonymous
Not applicable
i searched the forum but didn't seem to find an answer... sorry if this has been dealt with elsewhere/ earlier

i have a simple library part (similar to the picture library part).... and i would like to be able to have the object build a list of images DYNAMICALLY (say... in a designated folder in the loaded library).... so that if you want to change the image you can use a pull down list rather than having to type in the name manually (i also don't want to have to manually maintain the list within the object itself)

is this at all possible?

thanks for any insight/ assistance you can offer
6 REPLIES 6
Anonymous
Not applicable
This is possible. In order to do this, you would need to use file reading and have a random integer that will count the number of files to cycle through before choosing. then using the File IO functions in GDL have it scan a user defined location and select the random picture file and display it.

-- Matthew Peychich
Anonymous
Not applicable
matthew

thanks very much for the quick response

having had no experience with the functions that you have mentioned.... i guess a little trial and error is on the cards... unless someone has some sample code that may shed some light on this

thanks again
Anonymous
Not applicable
In my accessories i have used it, so later today when i have access to those files at the office, ill post a sample.

-- Matthew Peychich
Anonymous
Not applicable
matthew

thanks again for the quick response

i look forward to whatever code snippets you can provide to help with this

thanks again
Anonymous
Not applicable
parameters SidingIsLoaded=0
parameters LogIsLoaded=0
ParchToolsFolder = open( "FileMan", "ParchSidingFolder", "files, dialog" )
n = input( ParchToolsFolder, 0, 0, fileName )
while n = 1 do
	If fileName="parch sid_prof.gsm" Then
		parameters SidingIsLoaded=1
	EndIf
	If fileName="parch tools log.gsm" Then
		parameters LogIsLoaded=1
	EndIf
	n = input( ParchToolsFolder, 0, 0, fileName )
endwhile
close( ParchToolsFolder )
This is a little snippet from our Siding accessory that i made. the statements:
parameters SidingIsLoaded=0
parameters LogIsLoaded=0
set the value of the profile loaded to fals so it can check if any change is made to location and/or ownership of profiles. while this might not help you too much it shows that you can pass variable values to the file scan to supply function arguments later on in the code, which is what happens with those variables. they end up controlling the functionality of the object and changing the menu structure.
ParchToolsFolder = open( "FileMan", "ParchSidingFolder", "files, dialog" )
this sets a project variable that finds the system path and ties it to a certain location. This feature IS cross-platform. transfering the file from a win32 system to a Mac, will fail to find C:\Libraries\<path> and will end up asking for you to browse a new location.
n = input( ParchToolsFolder, 0, 0, fileName )
while n = 1 do
	If fileName="parch sid_prof.gsm" Then
		parameters SidingIsLoaded=1
	EndIf
	If fileName="parch tools log.gsm" Then
		parameters LogIsLoaded=1
	EndIf
	n = input( ParchToolsFolder, 0, 0, fileName )
endwhile
this will scan each file for its name and select report back a value. in this case it will find our profile files and mark them in the params by changing its value to true. you could use something that randomly generate a number or maybe if you are attempting to animate something, use a incremental value and have it load that image.
close( ParchToolsFolder )
this closes the directory
Anonymous
Not applicable
matthew

huge thanks for your code.... i will give it a try and see where i end up

thanks again