<?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: GDL: Button Interaction in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/378544#M57</link>
    <description>&lt;P&gt;The master script runs before the UI script too, and the query doesn't make sense in UI context - that is my first idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2023 08:13:05 GMT</pubDate>
    <dc:creator>Peter Baksa</dc:creator>
    <dc:date>2023-05-03T08:13:05Z</dc:date>
    <item>
      <title>GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376232#M49</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone have a clue why this button is not inversing the values, but instead is making them uniform?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the first entry is 1, I want all the entries to change to 0, and if it is 0 I want them all to become 1. Instead, it makes all the entries match the first...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;IF GLOB_UI_BUTTON_ID = 3 then
	IF sg_lengthToggle[1][2] = 0 then
			FOR i = 1 to sg_noBasement
				sg_lengthToggle[i][2] = 1
				PARAMETERS sg_lengthToggle[i][2] = sg_lengthToggle[i][2]
			next i
		ELSE
			FOR i = 1 to sg_noBasement
				sg_lengthToggle[i][2] = 0
				PARAMETERS sg_lengthToggle[i][2] = sg_lengthToggle[i][2]
			next i
	endIF
endIF&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.graphisoft.com/t5/Document-Visualize-forum/Level-Marking-in-Section-and-Elevation-for-a-Site-with-Multiple/td-p/373933" target="_blank"&gt;https://community.graphisoft.com/t5/Document-Visualize-forum/Level-Marking-in-Section-and-Elevation-for-a-Site-with-Multiple/td-p/373933&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 07:21:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376232#M49</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-11T07:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376241#M50</link>
      <description>&lt;P&gt;Is it a rerun problem? It looks to me that every time the code is run it will toggle the value. Should it perhaps be controlled using GLOB_MODPAR_NAME with the GLOB_UI_BUTTON_ID parameter?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 08:33:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376241#M50</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2023-04-11T08:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376243#M51</link>
      <description>&lt;P&gt;It should only be running once on button press, unless GLOB_UI_BUTTON_ID does not reset after function? You cannot seem to use GLOB_UI_BUTTON_ID with GLOB_MODPAR_NAME. Not sure how else to enforce a single run if that is the cause...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 09:03:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376243#M51</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-11T09:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376264#M52</link>
      <description>&lt;P&gt;Maybe try changing to&lt;/P&gt;
&lt;P&gt;PARAMETERS &lt;STRONG&gt;sg_lengthToggle = sg_lengthToggle&lt;/STRONG&gt; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: plus i suggest to move PARAMETERS before last ENDIF, not to do it &lt;STRONG&gt;inside&lt;/STRONG&gt; a loop&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 13:11:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376264#M52</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2023-04-11T13:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376286#M53</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11140"&gt;@Lingwisyer&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I managed to make it work by using a checkbox rather than a UI_BUTTON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;test = sg_lengthToggle[1][2]
if invert then
        for i = 1 to sg_noBasement
                sg_lengthToggle[i][2] = not(test)
        next i
        parameters invert = 0
endif
parameters sg_lengthToggle = sg_lengthToggle&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'invert' being the name of the checkbox. So if there is no necessity to use a button then you could juste stylize the checkbox like a button and that would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 16:17:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376286#M53</guid>
      <dc:creator>MetalFingerz</dc:creator>
      <dc:date>2023-04-11T16:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376478#M54</link>
      <description>&lt;P&gt;Either you have to set "Run parameter script only once" in Compatibility Options, or query whether the script is run first after a user interaction:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;isFirstRun = 0
success = APPLICATION_QUERY ("parameter_script", "firstoccasion_in_progress", isFirstRun)
if success &amp;amp; isFirstRun &amp;amp; GLOB_UI_BUTTON_ID = ...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 08:04:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376478#M54</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-04-13T08:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376483#M55</link>
      <description>&lt;P&gt;Put all my button queries between an IF statement of the first run query and it all works. Thanks again Peter.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 08:38:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/376483#M55</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-04-13T08:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/378311#M56</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/14532"&gt;@Peter Baksa&lt;/a&gt;&amp;nbsp;, can you only have one&amp;nbsp;&lt;EM&gt;first run&amp;nbsp;&lt;/EM&gt;query? I added a second one in my Master Script in order to offset array values, but it appears to break my buttons in my parameter script...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ps. Would appear to be so, or at least that I can't do it in both the Master and Parameter scripts at the same time. Merged my Master one into my Parameter one.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 04:22:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/378311#M56</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-05-02T04:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Button Interaction</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/378544#M57</link>
      <description>&lt;P&gt;The master script runs before the UI script too, and the query doesn't make sense in UI context - that is my first idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 08:13:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Button-Interaction/m-p/378544#M57</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-05-03T08:13:05Z</dc:date>
    </item>
  </channel>
</rss>

