Hi everyone,
I’m struggling with a Label script associated with Column elements (used as pile foundations). I am trying to sync data between these Labels and a "Legend Object" by writing to an external text file.
The Goal: Each associative Label on a pile (Column tool) writes its Building Material (COLU_CORE_BMAT_NAME) to a .txt file. A separate Legend Object then reads this file to automatically list only the pile types actually used in the project.
The Issue: The variable COLU_CORE_BMAT_NAME returns an empty string in the exported .txt file, even though the Label displays the information correctly on the floor plan.
Observed Behavior:
The value is only written to the TXT file if I manually open the Label Selection Settings or the Column Settings.
On a regular Floor Plan rebuild, library reload, or initial placement, the output file is updated, but the material name field is blank (while other strings/numbers in the same OUTPUT line are written correctly).
It seems the Global Variable isn't "fetched" or initialized in the Master Script's I/O context unless the element is explicitly activated in a dialog.
The Code (Master Script):
FILEstabiliteit = open("data", "ATstabiliteit.txt", "separator='\t', mode=wa, Library")
! 'test' and '1' are written, but COLU_CORE_BMAT_NAME is empty
output FILEstabiliteit, COLU_CORE_BMAT_NAME, 1, "test"
close FILEstabiliteit
Question: How can I force the Label to access the Column's COLU_CORE_BMAT_NAME during a background rebuild? Is there a more reliable REQUEST or a specific GLOB_CONTEXT trick to ensure the associative data is available when the OUTPUT command executes?
Any help would be greatly appreciated as this is the final link in my automated legend workflow!
AC 14 - 29
WIN 11
GDL