<?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: Using a Text File result to change parameters in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223520#M3554</link>
    <description>See the discussion and especially the last answer here:&lt;BR /&gt;
&lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10" target="_blank"&gt;&lt;LINK_TEXT text="viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10"&gt;https://archicad-talk.graphisoft.com/viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Basically Archicad automatically recognizes if the input is a number or a text and sets the variable type. &lt;BR /&gt;
In my experience if you work with simple variables (not arrays) you have to initialize them correctly - if you do sheetscale="" and then use it in an input command which returns a number, Archicad changes it to a number but somehow gets confused and returns errors.&lt;BR /&gt;
So either use sheetscale=0 when you expect numbers, do a "if vartype then split" or use arrays.</description>
    <pubDate>Fri, 20 Aug 2021 12:25:58 GMT</pubDate>
    <dc:creator>jan_filipec</dc:creator>
    <dc:date>2021-08-20T12:25:58Z</dc:date>
    <item>
      <title>Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223518#M3552</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi GDL experts,&lt;BR /&gt;&lt;BR /&gt;I am working with a simple txt. file to figure out how it can work. I have the code working that can search the first column of the text file and return a code based on the column number as below:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;FONT color="#0080FF"&gt;ch=OPEN("data",”Simple.txt”,"MODE=RO, DIALOG")
searchfield="A01"
nr=INPUT(ch,searchfield,1,sheetname, sheetscale)
text2 1,0,sheetname
CLOSE ch&lt;/FONT&gt;&lt;/PRE&gt;
&lt;BR /&gt;The output is text, in this case, 'Ground Floor'. If I enter numerical values into the txt. file in a third column, the output result seems to be still recognized by the GDL script as a text value.&lt;BR /&gt;&lt;BR /&gt;My goal is to use the output result above to drive parameters such as the length of an object based on the row selected. &lt;BR /&gt;&lt;BR /&gt;Question:&lt;BR /&gt;Is there a way to ask for a result, from a *txt file, that is in numerical format, so I can then use the result to change a parameter? &lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:50:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223518#M3552</guid>
      <dc:creator>GDL Enthusiast</dc:creator>
      <dc:date>2021-09-14T06:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223519#M3553</link>
      <description>Hi, use "SPLIT" command as describes in GDL-Manual!&lt;BR /&gt;
This makes STRING to NUMBERS.</description>
      <pubDate>Fri, 20 Aug 2021 08:09:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223519#M3553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-20T08:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223520#M3554</link>
      <description>See the discussion and especially the last answer here:&lt;BR /&gt;
&lt;A href="https://archicad-talk.graphisoft.com/viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10" target="_blank"&gt;&lt;LINK_TEXT text="viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10"&gt;https://archicad-talk.graphisoft.com/viewtopic.php?f=49&amp;amp;t=74023&amp;amp;start=10&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Basically Archicad automatically recognizes if the input is a number or a text and sets the variable type. &lt;BR /&gt;
In my experience if you work with simple variables (not arrays) you have to initialize them correctly - if you do sheetscale="" and then use it in an input command which returns a number, Archicad changes it to a number but somehow gets confused and returns errors.&lt;BR /&gt;
So either use sheetscale=0 when you expect numbers, do a "if vartype then split" or use arrays.</description>
      <pubDate>Fri, 20 Aug 2021 12:25:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223520#M3554</guid>
      <dc:creator>jan_filipec</dc:creator>
      <dc:date>2021-08-20T12:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223521#M3555</link>
      <description>Hi Ma_Scht and Jan,&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much for responding. After reading your posts, I realise I can't use a *txt file for both numbers and text when importing into Archicad as it has trouble distinguishing 0 null. I wonder how I could go about this problem:&lt;BR /&gt;
&lt;BR /&gt;
I would like to reference a list of GDL child part names to CALL i.e.&lt;BR /&gt;
&lt;FONT color="#0080FF"&gt;GDL Object Child Names&lt;BR /&gt;
01Part&lt;BR /&gt;
02Part&lt;BR /&gt;
03Part&lt;BR /&gt;
...&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
And for these GDL child part names, each would have a reference parameter such as an offset, or length that changes depending upon the part selected i.e.&lt;BR /&gt;
&lt;FONT color="#0080FF"&gt;01PartLength=0.01&lt;BR /&gt;
02PartLength=0.04&lt;BR /&gt;
03PartLength=0.03&lt;BR /&gt;
...&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to create something like a lookup table (like Excel), where the first values list selects the child object, and then, based on the selected child object, parameters in the Main (Parent) object change accordingly?&lt;BR /&gt;
&lt;BR /&gt;
Do you know of any links or scripts or example GDL objects that I could study for this too?&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much in advance!</description>
      <pubDate>Fri, 20 Aug 2021 14:27:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223521#M3555</guid>
      <dc:creator>GDL Enthusiast</dc:creator>
      <dc:date>2021-08-20T14:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223522#M3556</link>
      <description>Yes, there is an &lt;A href="http://gdl.graphisoft.com/reference-guide/gdl-xml-extension" target="_blank"&gt;add-on to read XML&lt;/A&gt;.&lt;BR /&gt;
It is not easy to use, but can get around the type problems.</description>
      <pubDate>Mon, 23 Aug 2021 15:13:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223522#M3556</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2021-08-23T15:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using a Text File result to change parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223523#M3557</link>
      <description>I agree with Peter; the XML add-on is the way to go.&lt;BR /&gt;
I have been using this add-on for 6 or 7 years now and it is how I enable an internal catalogue where the parameters are locked to values in an XML file.&lt;BR /&gt;
&lt;BR /&gt;
With TXT file you are selecting a specific cell based on it position, whereas with XML you a searching for a key/value pair which is far more intelligent, reliable and flexible.&lt;BR /&gt;
&lt;BR /&gt;
In the early days I struggled to work it out and there was no documentation on the tool apart from the GDL Reference Guide. The difficult bit was understanding how to "traverse the XML tree". I eventually worked it out with some help from the experts at GSHQ, who as a result, created more detailed documentation on the "GDL Center". Do a search for XML and you find the information you need.</description>
      <pubDate>Mon, 23 Aug 2021 23:15:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-a-Text-File-result-to-change-parameters/m-p/223523#M3557</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2021-08-23T23:15:10Z</dc:date>
    </item>
  </channel>
</rss>

