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

Using GDL Data I/O Add-on to list in layouts

Matthew Johnson
Advocate
I have two objects, one is a marker that users record data into and the second is a listing object that is supposed to take the data from all the markers on a layout page and list them in order. (For those that haven't guessed already I'm working on a revisioning system)

The marker object uses a Data I/O to push the information out to a text file;
ch1 = OPEN ("DATA", "RevisionControl.txt", "MODE = WA")
OUTPUT ch1, GLOB_INTGUID, 1, LayoutID, LayoutNumber, LayoutName, RevID, RevSub, RevNote, RevDate, RevPerson
CLOSE ch1
I'm using the GLOB_INTGUID as the data key because this is then a unique number for each marker that can be updated in the database if the marker object is modified. The LayoutID, LayoutNumber and LayoutName variables are requested from the layout page by the object and the various Rev__ variables are user entered data.

The list object is then supposed to pull this data in from the text file. BUT...
I can only get the INPUT command to pull in one row of data from the file and I have to know the specific key for each row to be able to pull it in.
ch1 = OPEN ("DATA", "RevisionControl.txt", "MODE = RO")
RevData = INPUT (ch1, "???", 1, LayoutID, LayoutNumber, LayoutName, RevID, RevSub, RevNote, RevDate, RevPerson)
CLOSE ch1
Once I find a way to get multiple rows of data in (to an array?) I then need to be able to filter down to just the marker data for objects on this page of the layout book.

Suggestions?
Matthew Johnson - POWE Architects
AC4.5 --> AC27 & Revit 2019 --> 2023
Asus Zenbook Pro 16x i9-13900H w/ Nvidia RTX 4070 4K dual, Windows 11 64bit
I'd rather be sailing.
12 REPLIES 12
sinceV6
Advocate
Hi.
I gave it a quick go and can confirm that:

1.- Using GLOB_INTGUID works to keep values correctly mapped in the database. You could use any parameter or string (like the ID) as long as you keep them consistent.
2.- Listing object updates as soon as you change any parameter in a marker object (after screen refresh -as in "pan" around-), as long as the lister is able to find the database (either loaded in the libraries, or by using DIALOG in the paramstring)

The downsides are that the list is not ordered -but could be rearranged using other commands-, and that since the database is being written by several objects, there would need to be a second (global) database so that you could delete records based on missing key values.
Matthew Johnson
Advocate
Solution I'm working with now;

1. Using a button in the UI of the listing object to clear the database and then get the user to Rebuild & Regenerate (Ctrl+Shift+Alt+R) to force all markers to re-write their details to the database. This overcomes redundant entries from deleted objects and also causes all data to be completely refreshed each time you need it.
2. As the database is re-built so often the issue of using the GUID isn't critical so I'm using a generated index which allows me to sort the revisions before putting them to the array.
3. I've centralised the data file locations using a request function on project names so that the data text file can be used as a data connection into Excel for producing change log reports for contractors.

Amazing that it has taken 10 years for the idea to crystalize enough to be able to get ArchiCAD to do this very simple task...
Matthew Johnson - POWE Architects
AC4.5 --> AC27 & Revit 2019 --> 2023
Asus Zenbook Pro 16x i9-13900H w/ Nvidia RTX 4070 4K dual, Windows 11 64bit
I'd rather be sailing.
JaseBee
Advocate
Hi Matthew,

I had almost this exact idea a few weeks back, and I found this topic today after finally getting ready to build it. this stream has already been a big help, thanks.

However I have already run into a few issues, between the homeDB not allowed but sorta able to be run in the parameter script, and a ridiculous non-existent channel error that I am positive exists, to certain bit's falling over in AC19 but working fin in AC21. It's been a rolling stream of profanity hurled at the screen...

All that aside, I think I can get past them all, however the one stick in the mud I can't get past is the regeneration.

You said you use Rebuild and Regenerate to reload all the markers data after purging everything to get rid of duplicates (brilliant way to deal with that problem by the way). However I am assuming both your markers and the purging object are present on the same layout? R&R only seems to work on the active view (or at the very best all open layout tabs) Is there some way you are regenerating all layouts?

I have tried the "Run Parameter Script of all Placed Objects" but that only seems to apply to those living in model space.

Or do you just purge data layout by layout (this is the solution I'm leaning toward...)

I've said it a million times, we should be able to schedule labels, and we should be able to schedule things that are placed outside plan view... Sigh.

Thanks for you work on this subject.
Jase.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram