Writing parameter values to a text file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 10:59 AM
I was wondering how to go about writing parameter values to an external text file for another object to read. Is this possible? and if so, would it work if the values in the object worked?
Thanks
Windows 10
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-25 04:14 PM
I've got the text reading and writing correctly...
How do I make it go to a new line?
I currently have this in my output but it doesn't seem to write to 2 separate rows
dstr = "" ch = OPEN ("DateTime", "", "%d/%m/%Y, %X") n = INPUT (ch, "", "", dstr) close ch zzxzx = str(symb_pos_x*1000, 3, 2) zzxzxz = str(symbol_pos_x*1000, 3, 2) text2 0, 0, dstr + " " + zzxzx name ="" nomplan = request("Name_of_plan", "", name) chOUT=OPEN ("TEXT", "filelog.TXT", "MODE=WO") OUTPUT chOUT, 1, 1, zzxzx OUTPUT chOUT, 2, 1, zzxzxz close chOUT
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 11:23 AM
However it is not live.
You amend object A and it will write to the text file.
But then you have to re-build and re-generate to get object B to read the text file (or just open object B's settings dialogue).
Maybe look into using Model View Options global variables.
That way you can make a setting in the MVO and all objects that use that value will instantly respond.
For example the door and window level of detail (2D & 3D) uses MVO values in this way.
You can also add an option to your objects to allow them to use the MVO settings or not, so you can keep them independent if you want.
Barry
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 11:37 AM
What I'm trying to achieve is to export numerical values of a position from object A and then have object B read that rather than set a setting on / off so using MVO's don't really help.
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 11:41 AM
JGoode wrote:I mean when you amend the actual object in the model (not the GDL).
when you say you amend object A, do you mean in the GDL editor or in the settings?
Any changes you make to object A will force the text file to be written to straight away.
But object B will not read it automatically.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 11:44 AM
Thanks very much
Windows 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-20 01:35 PM
I had a go but I can't seem to make it work. Here is my code...
ch1 = OPEN ("TEXT", "TEST123", "separator = ' ', MODE = WO") string = "12345" OUTPUT ch1, 1, 0, stringwhat am I doing wrong?
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-21 04:04 AM
However it will be writing the file to the Archicad Data folder.
This should be (by default) in your user profile - but it may be a hidden file.
For me it is at ...
C:\Users\your_user_name_here\AppData\Local\Graphisoft\ArchiCAD-64 Data Folder\ARCHICAD-64 21.0.0 AUS R1
AppData may be a hidden folder so you will have to show it in the file and folder options of Windows Explorer.
It is possible to set the file path.
It can be a fixed path or you can request the path by ....
rrr=REQUEST ("Name_of_plan", "", pname, pfullname, ppath) !print pname !print pfullname !print ppath file_name_start = STRSTR(ppath, pfullname) fold_path = STRSUB(ppath, 1, file_name_start-1) fspec=fold_path+"TEST123.txt" !print fspec ch1 = open ("TEXT", fspec, "separator = '\n', mode = wo") output ch1, 1, 0, "12345" close ch1But I am getting an error that says non-existent channel.
The folder path seems correct when I check it but for some reason it is not working.
It has been a long time since I have done this so maybe something has changed (I was testing in version 21) or I am just missing something obvious.
I will see if I can figure it out later.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-21 05:32 AM
Using "DIALOG", "FULLPATH" or "LIBRARY" is supposed to give some control of the file location.
DIALOG works but you will get fed up with browsing all the time.
FULLPATH is not working for me.
But I actually have used DATA in/out rather than TEXT in the past.
Slightly different in that you can read and write individual entries in a file.
The objects I have doing this are still working fine, so maybe it is just a problem with the TEXT in/out.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-09-25 04:14 PM
I've got the text reading and writing correctly...
How do I make it go to a new line?
I currently have this in my output but it doesn't seem to write to 2 separate rows
dstr = "" ch = OPEN ("DateTime", "", "%d/%m/%Y, %X") n = INPUT (ch, "", "", dstr) close ch zzxzx = str(symb_pos_x*1000, 3, 2) zzxzxz = str(symbol_pos_x*1000, 3, 2) text2 0, 0, dstr + " " + zzxzx name ="" nomplan = request("Name_of_plan", "", name) chOUT=OPEN ("TEXT", "filelog.TXT", "MODE=WO") OUTPUT chOUT, 1, 1, zzxzx OUTPUT chOUT, 2, 1, zzxzxz close chOUT
Windows 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-10-01 06:30 AM
https://www.indigofigs.com
https://www.facebook.com/indigofigs