<?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 Swap A and B parameters in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355182#M1188</link>
    <description>&lt;P&gt;Tbh I feel silly to ask such basic question, but I can't figure out how to swap values for A, B.&lt;/P&gt;&lt;P&gt;If additional parametes are created it's easy to change their values based on constant A, B. Though how to do it when with help of 2 parameters only? preferably main A, B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1TuKbeIqsUdWjve0QYYlYH62h2HNA5-T7/view?usp=drivesdk" target="_blank"&gt;https://drive.google.com/file/d/1TuKbeIqsUdWjve0QYYlYH62h2HNA5-T7/view?usp=drivesdk&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 06:28:43 GMT</pubDate>
    <dc:creator>A_ Smith</dc:creator>
    <dc:date>2022-09-06T06:28:43Z</dc:date>
    <item>
      <title>Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355182#M1188</link>
      <description>&lt;P&gt;Tbh I feel silly to ask such basic question, but I can't figure out how to swap values for A, B.&lt;/P&gt;&lt;P&gt;If additional parametes are created it's easy to change their values based on constant A, B. Though how to do it when with help of 2 parameters only? preferably main A, B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1TuKbeIqsUdWjve0QYYlYH62h2HNA5-T7/view?usp=drivesdk" target="_blank"&gt;https://drive.google.com/file/d/1TuKbeIqsUdWjve0QYYlYH62h2HNA5-T7/view?usp=drivesdk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 06:28:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355182#M1188</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2022-09-06T06:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355184#M1189</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12768"&gt;@A_ Smith&lt;/a&gt;&amp;nbsp;You need to clarify a bit more about where you are changing the values e.g. param-o or in a GDL script? In gdl you will need to create swap values e.g. a1 &amp;amp; b1 if you don’t want to loose the originals. You could also do a similar thing with Find &amp;amp; Replace.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 06:51:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355184#M1189</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2022-09-06T06:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355186#M1190</link>
      <description>&lt;P&gt;GDL.&lt;/P&gt;&lt;P&gt;In parameter script I planned to swap A, B - at least for now (when "bSwap" is true), without saving original values. Kinda temp=A, A=B, B=temp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Originally I wanted to swap values each! time "bSwap" is changed... Just in order to find out why that doesn't work, decided to make it simpler.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 07:06:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355186#M1190</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2022-09-06T07:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355194#M1191</link>
      <description>&lt;P&gt;I would:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF GLOB_MODPAR_NAME = bSwap then
temp = A
A = B
B = temp
PARAMETERS A = A
PARAMETERS B = B
PARAMETERS bSwap = 0
endIF&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 08:49:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355194#M1191</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-09-06T08:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355196#M1192</link>
      <description>&lt;P&gt;Right, but that doesn't work...&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 09:11:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355196#M1192</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2022-09-06T09:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355198#M1193</link>
      <description>&lt;P&gt;Try Ling's Parameter Script extract without the 'Parameters bSwap = 0' you will then know if the values are swapped.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 10:42:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355198#M1193</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2022-09-06T10:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355204#M1194</link>
      <description>&lt;P&gt;Well, I know it without deleting that row - it doesn't work as expected. I see that values don't change. Just to be sure, I removed it - all remais the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatelly trying to help without actually checking it, doesn't do the job. Because, it's so simle lines of code (strange to say it though) that can't be wrong. Nevertheless they do not obey.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 12:09:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355204#M1194</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2022-09-06T12:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355228#M1195</link>
      <description>&lt;DIV&gt;One for Grand Master &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/14532"&gt;@Peter Baksa&lt;/a&gt;&amp;nbsp;I think.&amp;nbsp;There appears to be some value protections in place for A, B &amp;amp; ZZYZX which don't apply to other parameters.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In the following, the values of A1 &amp;amp; B1 swap but the values of A, B &amp;amp; ZZYZX remain static...&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!PARAMETER SCRIPT
!Create values for bSwap (boolean) and A1 &amp;amp; B1 (real) in the parameters 

	A1 = A
	B1 = B

	PARAMETERS A1 = A1, B1 = B1

	IF GLOB_MODPAR_NAME = "bSwap" THEN 
	
		IF bSwap = 1 THEN
			A = B1
			B = A1
			ZZYZX = A1
		ELSE
			A = A1
			B = B1
			ZZYZX = B1
		ENDIF
		
		PARAMETERS A = A, B = B, ZZYZX = ZZYZX
	
	ENDIF&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 17:12:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355228#M1195</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2022-09-06T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355253#M1196</link>
      <description>&lt;P&gt;Odd... since I have replaced the A, B and ZZYZX values in objects before...&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 01:22:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355253#M1196</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-09-07T01:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355283#M1197</link>
      <description>&lt;P&gt;If I change the script to following it works for me:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;temp_A = A
temp_B = B

IF GLOB_MODPAR_NAME = "bSwap" then
	IF bswap = 1 THEN
		A = temp_B
		B = temp_A
		PARAMETERS A = A
		PARAMETERS B = B
		PARAMETERS bSwap = 0
	ENDIF
endIF&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:12:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355283#M1197</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2022-09-07T08:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355285#M1198</link>
      <description>&lt;P&gt;If I change the script to the following, it works for me (AC 22 and 26 on macOS)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!PARAMETER SCRIPT
!Create values for bSwap (boolean) and A1 &amp;amp; B1 (real) in the parameters 

	A1 = A
	B1 = B

	PARAMETERS A1 = A1, B1 = B1

	IF GLOB_MODPAR_NAME = "bSwap" THEN 
	
		IF bSwap = 1 THEN
			A = B1
			B = A1
			ZZYZX = A1
		ELSE
			A = A1
			B = B1
			ZZYZX = B1
		ENDIF
		
		PARAMETERS A = A, B = B, ZZYZX = ZZYZX, bSwap = 0
	
	ENDIF&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:13:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355285#M1198</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2022-09-07T08:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355291#M1199</link>
      <description>&lt;P&gt;Logic failure on my part.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt; Without setting bSwap back to Zero the swap would be constantly valid and would try to change A &amp;amp; B every time the Parameter script was run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12768"&gt;@A_ Smith&lt;/a&gt;&amp;nbsp;a working solution...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!PARAMETER SCRIPT
!Create values for bSwap (boolean) and A1 &amp;amp; B1 (real) in the parameters 


	IF GLOB_MODPAR_NAME = "bSwap" THEN 
	
		A1 = A
		B1 = B
		PARAMETERS A1 = A1, B1 = B1

		IF bSwap = 1 THEN
			A = B1
			B = A1
		ENDIF
		
		bSwap = 0

		PARAMETERS A = A, B = B, bSwap = bSwap
	
	ENDIF&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR use&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/13883"&gt;@Jochen Suehlo&lt;/a&gt;&amp;nbsp;earlier solution which I missed due to this stupid forum formatting.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:54:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355291#M1199</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2022-09-07T08:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355293#M1200</link>
      <description>&lt;P&gt;Indeed. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Though, my brain still can't except that this works only due to overriding bSwap - "parameters bSwap=0". Without it should work too, right? just instead I would have to 'unckeck' bSwap and then make it true again (but that doesn't work).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:55:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355293#M1200</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2022-09-07T08:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Swap A and B parameters</title>
      <link>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355374#M1201</link>
      <description>&lt;P&gt;If you wanted to, you could double the script within the ModPar with&amp;nbsp;&lt;EM&gt;IF bSwap = 1 then Else endIF&lt;/EM&gt;. By doing this it should just keep swapping each time you check it.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 02:18:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Swap-A-and-B-parameters/m-p/355374#M1201</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-09-08T02:18:16Z</dc:date>
    </item>
  </channel>
</rss>

