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

GDL DATA I/O ADD-ON for Parameter Values

Anonymous
Not applicable
After some years of watching this forum, i have a question regarding the GDL Data Add-On in Parameter script.

Actual i'm writing a new zonestamp, where i want to read the Parameter Values from an external .txt file.

Thank to Cookbook the first step is working without problems.
Master Script:

dim values_nutzung_01[]
FOR I=1 TO 1
values_nutzung_01=".........."
NEXT i

ch1 = OPEN ("TEXT", nutzung_01.txt,"SEPARATOR ='#', MODE = RO,LIBRARY")
linecount=1
nr = INPUT (ch1 ,linecount, 1, v1,v2)
WHILE nr>0 DO
values_nutzung_01[linecount]=v1
linecount=linecount+1
nr = INPUT (ch1 ,linecount, 1, v1)
ENDWHILE
close ch1

Parameter Script:

VALUES "nutz_01" "Keiner",para_nutzung_01

But for a second paramter i want to have only a selection of values in the .txt file as Values in my object.

For example when the first parameter "nutz_01" is set to 3.1 the second parameter should have all values that starts with 3.1 in the text file.
(f.e "3.1 Office", "3.1 Storage" but not "3.2 Restrooms")

I have tried to realise this with:
....
ch1 = OPEN ("DATA", filename,"SEPARATOR ='#', MODE = RO,LIBRARY")
linecount=1
searchfield='3.1'
nr = INPUT (ch1 ,linecount, 1, v1,v2)
WHILE nr>0 DO
values_nutzung_02[linecount]=v1
linecount=linecount+1
nr = INPUT (ch1 ,linecount, 1, v1,v2)
ENDWHILE
close ch1

But with this i get only the last with 3.1 beginning value and not all.
I know the problem i that linecount isn't working, but i have no idea
how i can solve it.

I hope some of you can comprehend my problem and have an idea
for a solution.

Thanks in advance
7 REPLIES 7
NandoMogollon
Expert
Hi,
I can't tell you in which direction you be should looking, I am pretty much in the same situation. I'm trying to use the DATA ADD-ON and the TEXT ADD-ON for my own projects. But is really hard due to the lack of information provided by Graphisoft and third parties.
I have the GDL Cookbook 3.0 and the GDL Handbook (cadimage), and a couple of websites: http://www.selfgdl.de/, http://www.GDLCentral.com.
As you can see, not too much.
I can't find objects using this DATA/TEXT add-on, it would be helpful to open the script and take look.
Please stay in touch, and please share your knowledge on this. I would do it I if I knew something more precise about it.

Good luck with your project

Regards

Nando M
Nando Mogollon
Director @ BuilDigital
nando@buildigital.com.au
Using, Archicad Latest AU and INT. Revit Latest (have to keep comparing notes)
More and more... IFC.js, IFCOpenShell
All things Solibri and BIMCollab
Anonymous
Not applicable
Hello,

Here is a kind of value list filler object. I put in two alternative ways
of reading / mining the data from the txt file. Hope someone finds it
useful.


!-- four string type parameters needed;
!-- "valuelist_a", "valuelist_b", "valuelist_c", "search"

!-- the code can be a master or value script

dim value_a[], value_b[], value_c[]

filename= "Table.txt"
ch1=OPEN("TEXT",filename,"SEPARATOR='\t',MODE=RO,LIBRARY")

	!--counting the total number of rows
	do
		row= row+1
		n=INPUT(ch1,row,1,string1)
	while n>-1


	!--reading the first column for valuelist_a
	for k= 1 to row-1
		n=INPUT(ch1,k,1,string1)
		value_a= string1
	next k

	!--reading the first column for valuelist_b if starts with the search string (valuelist_a)
	len= strlen(valuelist_a)
	for k= 1 to row-1
		n=INPUT(ch1,k,1,string1)
		if strsub(string1, 1, len)= valuelist_a then
			r= r+1
			value_b= string1
		endif
	next k


	!--reading both columns for valuelist_c if contains the search string
	for k= 1 to row-1
		n=INPUT(ch1,k,1,string1,string2)
		if strstr(string1+string2, search) then
			s= s+1
			value_c= string1+ " - "+ string2
		endif
	next k

CLOSE (ch1)

values "valuelist_a" value_a, custom
values "valuelist_b" value_b
values "valuelist_c" value_c

Regards, Juha
Anonymous
Not applicable
Here is the library.

--
Regards, Juha
NandoMogollon
Expert
Thanks Juha.
I am having problems with the "Dialog" parameter. It works for AC12, and 13, not for 14.
I can't select/open any file with the open dialog window.

Anyone else experiencing this problem?

regards

Nando
Nando Mogollon
Director @ BuilDigital
nando@buildigital.com.au
Using, Archicad Latest AU and INT. Revit Latest (have to keep comparing notes)
More and more... IFC.js, IFCOpenShell
All things Solibri and BIMCollab
NandoMogollon
Expert
This is actually a very good piece of code.
I'm adding it to my "Specifications Label" object, and it looks very promising.
I will add it to the GDL depository when finished

Thanks for sharing it Juha

Best regards

Nando
Nando Mogollon
Director @ BuilDigital
nando@buildigital.com.au
Using, Archicad Latest AU and INT. Revit Latest (have to keep comparing notes)
More and more... IFC.js, IFCOpenShell
All things Solibri and BIMCollab
Anonymous
Not applicable
HI
I am struggling with the INPUT and OPEN as well, but it seems that you have gotten a bit further than I am.
I have some basic problems understanding the basics.
I understand the OPEN command but I am lost in the INPUT. It seems that it only works with a statement called "n" or "nr" what is that good for?
The GDL reference gives an example:

nr = INPUT (ch1, 1, 1, v1, v2, v3) ! input of three values from the first ! column of the
first row
PRINT nr, v1, v2, v3

when I type in these lines in the Master script I get an error message saying that the variables are uninitialized - why is that?
NandoMogollon
Expert
hi "hvid"
the sequence of commands open and input work together, OPEN just makes the call, while INPUT ask for the specific cell (this row, that column, and name it like this)
It is not 2+2... Is not vary clear for me either, but If I finish soon with my problems here, let say this week, I'll try to do some sort of tutorial, I'll make it public here.

regards

Nando
Nando Mogollon
Director @ BuilDigital
nando@buildigital.com.au
Using, Archicad Latest AU and INT. Revit Latest (have to keep comparing notes)
More and more... IFC.js, IFCOpenShell
All things Solibri and BIMCollab