<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Writing parameter values to a text file. in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245320#M3702</link>
    <description>when you say you amend object A, do you mean in the GDL editor or in the settings? &lt;BR /&gt;
&lt;BR /&gt;
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.</description>
    <pubDate>Thu, 20 Sep 2018 09:37:55 GMT</pubDate>
    <dc:creator>JGoode</dc:creator>
    <dc:date>2018-09-20T09:37:55Z</dc:date>
    <item>
      <title>Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245318#M3700</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hello,&lt;BR /&gt;
&lt;BR /&gt;
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?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:59:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245318#M3700</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-09-20T08:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245319#M3701</link>
      <description>It is possible with the text and data input/output commands.&lt;BR /&gt;
However it is not live.&lt;BR /&gt;
You amend object A and it will write to the text file.&lt;BR /&gt;
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).&lt;BR /&gt;
&lt;BR /&gt;
Maybe look into using Model View Options global variables.&lt;BR /&gt;
That way you can make a setting in the MVO and all objects that use that value will instantly respond.&lt;BR /&gt;
For example the door and window level of detail (2D &amp;amp; 3D) uses MVO values in this way.&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Barry</description>
      <pubDate>Thu, 20 Sep 2018 09:23:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245319#M3701</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-09-20T09:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245320#M3702</link>
      <description>when you say you amend object A, do you mean in the GDL editor or in the settings? &lt;BR /&gt;
&lt;BR /&gt;
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.</description>
      <pubDate>Thu, 20 Sep 2018 09:37:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245320#M3702</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-09-20T09:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245321#M3703</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;
when you say you amend object A, do you mean in the GDL editor or in the settings? 
&lt;/BLOCKQUOTE&gt;

I mean when you amend the actual object in the model (not the GDL).&lt;BR /&gt;
Any changes you make to object A will force the text file to be written to straight away.&lt;BR /&gt;
But object B will not read it automatically.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Thu, 20 Sep 2018 09:41:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245321#M3703</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-09-20T09:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245322#M3704</link>
      <description>This is definitely an option for what I want. Do you have any idea about how to use the OPEN, INPUT, OUTPUT etc... I have read about it in the Reference Guide but it's not very clear and doesn't provide as much information as I'd like.&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much</description>
      <pubDate>Thu, 20 Sep 2018 09:44:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245322#M3704</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-09-20T09:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245323#M3705</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I had a go but I can't seem to make it work. Here is my code...
&lt;PRE&gt;ch1 = OPEN ("TEXT", "TEST123", "separator = ' ', MODE = WO")

string = "12345"
OUTPUT ch1, 1, 0, string &lt;/PRE&gt;

what am I doing wrong?</description>
      <pubDate>Thu, 20 Sep 2018 11:35:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245323#M3705</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-09-20T11:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245324#M3706</link>
      <description>This should be working fine.&lt;BR /&gt;
However it will be writing the file to the Archicad Data folder.&lt;BR /&gt;
This should be (by default) in your user profile - but it may be a hidden file.&lt;BR /&gt;
For me it is at ...&lt;BR /&gt;
C:\Users\your_user_name_here\AppData\Local\Graphisoft\ArchiCAD-64 Data Folder\ARCHICAD-64 21.0.0 AUS R1&lt;BR /&gt;
&lt;BR /&gt;
AppData may be a hidden folder so you will have to show it in the file and folder options of Windows Explorer.&lt;BR /&gt;
&lt;BR /&gt;
It is possible to set the file path.&lt;BR /&gt;
It can be a fixed path or you can request the path by ....&lt;BR /&gt;

&lt;PRE&gt;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 ch1&lt;/PRE&gt;

But I am getting an error that says non-existent channel.&lt;BR /&gt;
The folder path seems correct when I check it but for some reason it is not working.&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
I will see if I can figure it out later.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 21 Sep 2018 02:04:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245324#M3706</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-09-21T02:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245325#M3707</link>
      <description>I haven't had a really good look but I see in the reference manual ...&lt;BR /&gt;



Using "DIALOG", "FULLPATH" or "LIBRARY" is supposed to give some control of the file location.&lt;BR /&gt;
DIALOG works but you will get fed up with browsing all the time.&lt;BR /&gt;
FULLPATH is not working for me.&lt;BR /&gt;
&lt;BR /&gt;
But I actually have used DATA in/out rather than TEXT in the past.&lt;BR /&gt;
Slightly different in that you can read and write individual entries in a file.&lt;BR /&gt;
The objects I have doing this are still working fine, so maybe it is just a problem with the TEXT in/out.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 21 Sep 2018 03:32:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245325#M3707</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-09-21T03:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245326#M3708</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've got the text reading and writing correctly...&lt;BR /&gt;
How do I make it go to a new line?&lt;BR /&gt;
&lt;BR /&gt;
I currently have this in my output but it doesn't seem to write to 2 separate rows&lt;BR /&gt;

&lt;PRE&gt;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&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 14:14:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245326#M3708</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-09-25T14:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245327#M3709</link>
      <description>Just tested your script and it works. Try opening the log file with WordPad or Notepad++, not just Notepad, to see that it actually creates a new line.</description>
      <pubDate>Mon, 01 Oct 2018 04:30:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245327#M3709</guid>
      <dc:creator>Palawat</dc:creator>
      <dc:date>2018-10-01T04:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245328#M3710</link>
      <description>Have you looked at the GDL Center Tips? It might help:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://gdl.graphisoft.com/tips-and-tricks/how-to-read-and-write-text-files" target="_blank"&gt;&lt;LINK_TEXT text="http://gdl.graphisoft.com/tips-and-tric ... text-files"&gt;http://gdl.graphisoft.com/tips-and-tricks/how-to-read-and-write-text-files&lt;/LINK_TEXT&gt;&lt;/A&gt;</description>
      <pubDate>Fri, 05 Oct 2018 04:10:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245328#M3710</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-05T04:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Writing parameter values to a text file.</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245329#M3711</link>
      <description>Thanks for that! I didn't  realise that notepad wouldn't put it on a new line!</description>
      <pubDate>Fri, 05 Oct 2018 10:15:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Writing-parameter-values-to-a-text-file/m-p/245329#M3711</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-10-05T10:15:41Z</dc:date>
    </item>
  </channel>
</rss>

