cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Streamline your workflows and master BIM coordination! Program starts April 28!

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

Modifying text file in an embedded library

Not applicable
I'm trying to have a read/write text file in an embedded library *.lcf file in order to look-up/update some "global" values for the library (not individual *.pln files)

According to the ArchiCAD GDL help page:
"If the LIBRARY keyword is present, the data file must be in the loaded library.
Opening data file from the loaded library for reading is possible from all scripts, but writing is only enabled in the parameter, user interface and property scripts."

Initially I had put the following code into the parameter script:

IF reset THEN !!trigger parameter

ch2=OPEN("TEXT","lic.txt","SEPARATOR='\t',MODE=WO,LIBRARY")
OUTPUT ch2,1,1,"d", "test message", "d", "d"
CLOSE (ch2)

ENDIF

I get the following error:

Open error
while operating on file 'lic.txt'.
Nonexistent channel
at line 4 in the Parameter script of file Unitary Reset.gsm. (9835-1 Page108)
Nonexistent channel
at line 5 in the Parameter script of file Unitary Reset.gsm. (9835-1 Page108)

Then, I had put the opening of the channel (first line) into the Master script and get the following error:
"Open error
while operating on file 'lic.txt'.
Cannot modify the file (lic.txt) in embedded library in 2D script type."

What am I doing wrong?

Thank you for your advice in advance
1 REPLY 1
Not applicable
Hello,

I think writing to a file inside a LCF (library container file)
is not possible. Try writing a separate txt-file.