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

FREE for Download - The FreeKeyNote Label Project

NandoMogollon
Expert
Is there any some Merciful GDL Guru with enough time to help me ( and maybe others) to clarify this problem? :

1- The problem:
I am trying to make a custom Label capable of read the information saved on a txt file. It works fine the first time it reads the information, but if you change the content of the text on the txt file, the label doesn't change and in fact it changes the content to the first record on the database (txt file)
2- the question:
Is it a normal behavior? Can I avoid this problem somehow?

I can upload the library part and the txt file if necessary

Please give me some tips

Best 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
40 REPLIES 40
NandoMogollon
Expert
Hi All

I have something to share.
I hope you can try it, improve it and share it.

It is still a Beta Version, but so far it does meet this requirements:
From Erika's Original Requirements
1. I could optionally display its alphanumeric key and/or the description text.
2. Rearranging the order of a sheet's notes would automatically update the placed keynotes [within that layer combination].
3. It could be connected to one's specifications. (with hyperlinks too)
4. One could have a master keynote list for an entire project
5. One could have separate keynotes by sheet type i.e floor plan, RCP, etc aka the layer combination.

It does not meet this ones:
From Erika's Original Requirements
6. It would be a part of the file data that can be extruded from one's model.
7. It would be user friendly.
The Zip file Contains a Quick Tutorial.

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
By the way be aware, it was done with AC14, so GDL version is 27, I don't think it will work with older versions of AC.

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
Ben Cohen
Advocate
I like Nando's, so I thought I would post a few improvements

I re-jigged the master script so that your user can see a value list of all the codes, plus I simplified it a lot. The label you have doesn't really stretch very well, label scripting is a pain, so I would try and find something to base the label on - maybe a GS label, instead of starting from scratch. Then just feed in your code for the text input ... I think others have posted labels before, I think Masterscript did one recently.

Well HTH, good luck with your project!
Ben Cohen
Mac and PC
Archicad (Latest Version) aus
www.4DLibrary.com.au
NandoMogollon
Expert
Hi Ben, I just downloaded your version.
Regarding the question about How it deals with long texts: Theres is a restriction of 255 characters per string, that means around 35-40 words.

What I would like to do is to have 3 columns/strings, counting from the left to the right: the Code, The name or short description, The long Description of the work.

Having this, the next step, will be to have an object scheduling all three columns, so you can put it on the layout for each drawing. But this will be the next project.

I'll give some feedback soon.

Thanks for the help Ben.

Regards

Nando.

P.S. Yeah, I like Nando's PeriPeri chicken too.
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
alemanda
Advocate
I've read right now about this topic?
Some times ago I made my own keynote object but I never used it.
Now I don't have the gsm file with me (I have it in the laptop) ... but I will pubblish it.
I couldn't open your keynote because I don't want to install AC14 (I use happily AC13) ... but I saw the txt file associated ...
I have one comment about it. Why the database is written one item after one item and not one item per row (which is much easier to understand it)?
Moreover ... I remember that I made also another object which makes the list of all the item in the database and order them in one or more columns ...
... I will pubblish my keynote ... just to add some more feature to yours ...
Regards.
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
NandoMogollon
Expert
Hi alemanda,
I would share again the Code Up to Date soon. I have been busy and had no time for it.
Give me a couple of days and It will be posted.

FreeKeyNoteBETA 2, coming.

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
Frank Beister
Moderator
Actually that is what I have been doing here: loading the Text file as Linked Library. But even if you reload the library (containing of course our txt file) the label does not show the updated text. Note that the object itself - its script - can read the txt file and can recognize the change. You can check that by opening the Label settings window, under Parameters, you will see the "Select an option:" field updated!.

What it means to me is that the script is capable of recognize and read the changes made to the txt file, But is not capable of update the 2D Representation of the text related to that parameter.
I haven't had a look into your code, but it works with text files well for me. Aslong as it is not a teamwork project.

-----

If the text file is in a linked library, I can read and write the file from the settings dialog of my label object. The other instances of the labe, placed in floor plan and s/el, which should show the same (changed) text are updated, after I reload the library. This works only, if the 2D-script reads the output directly out of the txt file and gets not the text from a cache in form of stored in parameters.

If I change the project to a teamwork project and upload the linked library to the server, my textfile does still exist and I can still change it from the label settings dialog. But I haven'nt found a way to upload the changes to server, that all teamwork clients have the same file to read the data from. I do not even find, where my changes do effect.

------

@Ben
I have thought about the MVO-idea. I am not shure, if it is not more dangerous to get data chaos because of different MVO-settings.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
NandoMogollon
Expert
For those of you interested on the Code itself:

!!!******MASTER SCRIPT******!!!
!! --declarations
dim value_a[]
dim value_f[]
dim codes[]
string1 = ""
string2 = ""
string10 = " "
string20 = " 
TXSH = ""
row = 0

!!---Open channel
ch1=OPEN("TEXT",filename,"MODE=RO,LIBRARY") 

!!!!!!!!!!!******counting the total number of rows*********!!!!! 


   do 
      row= row+1 
      n=INPUT(ch1,row,1,string1,string2) 
		codes[row] = string1
	if strstr(string1+string2,fndit) then
		s=s+1
		value_f = string1+ "-" +string2
	endif
	if string1 = search then 
		string20 = string2
		string10 = string1
	endif
   while n>-1 

CLOSE (ch1) 


IF SELCODE= "Only Code" THEN
	TXSH= string10	
ENDIF

IF SELCODE= "Only Name" THEN
	TXSH= string20	
ENDIF

IF SELCODE= "Code & Name" THEN
	TXSH= string10+ "" + SEPCOD + "" +string20	
ENDIF


!!---Create Value lists
values "valuelist_a" string10 + " - " + string20
values "valuelist_f" value_f
values "SELCODE" "Only Code", "Only Name", "Code & Name" 
values "TXSHOWN" TXSH
values 'search' codes	!,custom
And
!!!********2D SCRIPT********!!!!
!!!!********* DEFINE THE PARAGRAPH STYLE
DEFINE STYLE{2} TypA LABEL_FONT_NAME, LABEL_TEXT_SIZE*GLOB_SCALE/1000, LABEL_FONT_STYLE

PARAGRAPH "PARRAFO" LABEL_TEXT_ALIGN, 1*GLOB_SCALE/1000, 1*GLOB_SCALE/1000, 1*GLOB_SCALE/1000, 1, 0
PEN 1
SET STYLE "TypA"

"" + TXSH 

ENDPARAGRAPH


IF LABEL_TEXT_ALIGN=1 THEN
GLAS=4
ANGFN= 0
ENDIF

IF LABEL_TEXT_ALIGN=3 THEN
GLAS=6
ANGFN= 180
ENDIF

IF LABEL_TEXT_ALIGN=2 THEN
GLAS=8
ANGFN= 90
ENDIF

IF LABEL_TEXT_ALIGN=4 THEN
GLAS=4
ANGFN= 0
ENDIF


IF HOR THEN
AGL=270
ELSE
AGL=0
ENDIF



TANRE= TANCM*GLOB_SCALE


TEXTBLOCK "FIFI" TANRE, GLAS, AGL, 1, 1, 0, "PARRAFO"

RICHTEXT2 FNX, FNY, "FIFI"

Don't forget to add the parameters.
The following is work in progress, feel free to built your own interface:---->
Param.png
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
Hi
I am still working on this label. Hopefully to get a final version within the next weeks.
So far I'm having trouble with some GDL behaviors. Please help me if know the reason for this:
1. When reading a txt file, the code is unable to read plain numbers as single strings. Why is that? Do we have to define the "vartype" of the information to be read?

2. Within the official documentation and the GDL cookbook the information regarding STRSTR, STRLEN, STRSUB, VARTYPE, and the difference when opening text channels and data channels is vague and sometimes ambiguous.
If you have worked with these, would you please provide some clarification on how those commands actually work?

I will really appreciate any comments or opinions.
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
Frank Beister
Moderator
STRSTR, STRLEN, STRSUB, VARTYPE work in the same way, if used with variables, parameters or variables read from TXT files.

Can you explain your problems by your GDL-code?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm