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

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

Outputting to a txt. file

Anonymous
Not applicable
I'm nearly finished building my GDL object, and to finish it off I want to output information about the object to a txt. file eg: length, description of individual parts in the object, their quantity, so i can send this to Access to work out a final price of the job. The script works fine for one GDL object but if I add another one the initial information sent to the txt file is overwritten by the next object.
How do I rescript it so that this wont happen, at the minute I am exporting individual files to Access when instead it would be easier and quicker to just send 1.
This is part my script:

Executive script:
IF outdat THEN GOSUB 900: !File I/O
END
!----------------------------------------------------------------

900: ! File OUTPUT Routine

!Write Costings Access Report File
ch1= OPEN("TEXT", acost+".txt","SEPARATOR='\t',MODE=WO")

OUTPUT ch1, 1,0, "Description","Qty","Length","Type","Qty per Length","Cost/Unit","Cost","Weight (kg/m)","Weight/Unit (kg)","Total Weight (kg)"

OUTPUT ch1, 1,0, "Ball",nosections," ",ball*1000," ",F1,F1*(nosections),spherew,spherew,spherew*nosections

Close ch1

In parameters I tpye in the what name I want to call the file and this is related to: acost
1 REPLY 1
Anonymous
Not applicable
Robert1083 wrote:
ch1= OPEN("TEXT", acost+".txt","SEPARATOR='\t',MODE=WO")
MODE = WO overwrites the existing file

MODE = WA appends to the existing file

There may be quite a bit more to get this to work for you though, depending on just precisely what you want to do. Clearly you don't want to keep appending more and more data forever. The simplest thing might be to set the database to clear the contents when it reads the file.

Managing data through intermediary text files can be troublesome though. You might do better to use the interactive scheduler to extract the data for you.