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

TXT file to GDL to Label - Update Notes automatically

Anonymous
Not applicable
I am trying to make a label that is populated by notes from a .txt file. So far, I have successfully been able to get the parameter values to populate with help from this thread*

http://archicad-talk.graphisoft.com/viewtopic.php?t=46716&view=next&sid=85e44afe0d8cfeb244426c0e8a275512

My question is, how can I get the label/notes to update automatically when I change the text file. Currently, when I reload the library, the parameter values update correctly, but the actual text displayed by the label remains unchanged. I have to manually open each label and select the updated text (defeating the whole purpose of this tool). Any help would be appreciated, I am still new to gdl. Thank you!

*I think that thread is talking about very similar things, but I thought it best to start a new one, as that one is 2 yrs old.
10 REPLIES 10
Some kind of trigger parameter must be made, then the objects should be put in the schedule with this parameter (only)

Make a Boolean parameter (on/off)
make it the way it will be switching off after switched on
with GLOB_MODPAR_NAME.

When need to update just populate the prepared schedule and click the parameter you prepared (it will be on and off right a way)

This is all because the script must be rebuild...and such trigger parameter will do that.

Best Regards,
Piotr
Anonymous
Not applicable
Thanks for your reply Piotr.

I think I understand what you are saying - the object I am creating should be scheduled, and then I can "edit" the object using the schedule, by flipping the boolean parameter?

If this is what you mean, I have a problem, which is that my object is a label. I can't seem to schedule a label?

Thanks!
alemanda
Advocate
Is it for key noting purpose?
If so, why don't you use the ifc properties and the tha tag&categories label?
There's a video tutorial by Eric Bobrow which is "illuminating".
http://youtu.be/hOvxqJL-Qvs
It works well and it can be easily controlled by the interactive schedule.
The only limitation I see is that you cannot format the texts ...
AC27 latest hotfix

Win 10 Pro 64bit

Double XEON 14 CORES (tot 28 physical cores)

32GB RAM - SSD 256GB - Nvidia Quadro K620

Display DELL 25'' 2560x1440

www.almadw.it
Anonymous
Not applicable
That is an interesting idea, and one that may be useful.

However, most of the notations that we do occur in details, which is 2D geometry (lines and fills). It seems that this would be impossible to link to the object's IFC property?
alemanda
Advocate
Yes ... this is the only (and strong) limitation ...
AC27 latest hotfix

Win 10 Pro 64bit

Double XEON 14 CORES (tot 28 physical cores)

32GB RAM - SSD 256GB - Nvidia Quadro K620

Display DELL 25'' 2560x1440

www.almadw.it
Anonymous
Not applicable
So... back to the original question: is there anyway to force my label to automatically update itself when the text file is updated?
Anonymous
Not applicable
Kyle,
Did you ever find a workaround for this? I am currently trying to achieve a similar thing

Tom
JaseBee
Advocate
Hi Guys,

I've dealt with this problem quite a bit, it is frustrating but I believe you will be able to get it to behave as you expect it to.

The key lies in the fact that you are defining it as a parameter (as I understand from what you've been saying), and then the 2d text is built from this parameter. the parameters do not update until they are asked to (object is modified, of called upon by archicad to).

What you have to do is have your "input" command present in your master script and write the value you've read from your note list to the parameter WITHOUT using the parameters command, then define the parameter as itself WITH the parameters command.

For example:

INPUT (1, 1, "NoteString") (or whatever the format is, I can't recall)

TextOutputParameter = NoteString
PARAMETERS TextOutputParameter = TextOutputParameter

Then write out your text as you were normally.

Whats happening is when you change the value of a parameter with the parameters command, it is only changing it within the parameter script so if the value of your input changes and the parameter script is not run then it will display the old values.

By changing parameters using the method described above the actual value will change, and the next time the parameters script is run (calling up an schedule, or opening the tool box) it will catch up and also display correctly.

I think that should work for you.

Happy bug hunting!
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram
Anonymous
Not applicable
F YEAH
Cheers mate. I made it so in the parameter script the id of the pulldown window gets sent to a parameter
1.Project note 1 > sets textNumber to 1
2.Project note 2 > sets textNumber to 2
.....

Then in the master (please ignore my lazy copy and paste coding, I'm not usually this bad)

DIM sarray2[]
filename = "ProjectNotes.txt"
ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY")
i = 1
j = 1
sarray2[1] = ""
! collect all strings
DO
n4 = INPUT (ch1, i, 1, var)
IF n4 > 0 AND VARTYPE (var) = 2 THEN
sarray2 = var
j = j + 1
ENDIF
i = i + 1
WHILE n4 > 0
CLOSE ch1

textOutputFull = sarray2[textNumber]
findDot = strstr(textOutputFull, '.')
len = STRLEN(textOutputFull)
textOutput = strsub(textOutputFull, findDot+1, len-findDot)

To update all the labels on the project, I just need to refresh the library.