<?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: Refresh the variable in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235869#M3966</link>
    <description>You should also set the values in a local parameter so you don't have to wait for the parameter to update for the 2D and 3D representations to update, like this:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;if glob_modpar_name = "delka_2" then
	delka_3 = delka_2/cos(sklon)
	parameters delka_3 = delka_3
	A = delka_2/cos(sklon)
	parameters A = A
else
	delka_2 = delka_3*cos(sklon)
	parameters delka_2 = delka_2
	A = delka_3
	parameters A = A
endif
&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Jan 2021 21:38:08 GMT</pubDate>
    <dc:creator>Kristian Bursell</dc:creator>
    <dc:date>2021-01-11T21:38:08Z</dc:date>
    <item>
      <title>Refresh the variable</title>
      <link>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235867#M3964</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hallo,&lt;BR /&gt;&lt;BR /&gt;how do I reset the value of the variable "delka_2" if I change the value of the variable "sklon"?&lt;BR /&gt;&lt;BR /&gt;It makes a mistake in the floor plan. See picture. The length of the line changes but the distance of the point no longer.&lt;BR /&gt;&lt;BR /&gt;Thank you &lt;IMG style="display: inline;" src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" border="0" /&gt;&lt;BR /&gt;&lt;BR /&gt;MAIN code
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;IF	GLOB_MODPAR_NAME = "delka_3"	THEN
	PARAMETERS delka_2 = delka_3*cos(sklon)
	PARAMETERS A = delka_3
ENDIF
IF	GLOB_MODPAR_NAME = "delka_2"	THEN
	PARAMETERS delka_3 = delka_2/cos(sklon)
	PARAMETERS A = delka_2/cos(sklon)
ENDIF
&lt;/PRE&gt;
&lt;BR /&gt;2D code
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;		HOTSPOT2 0,				0, unID, delka_2, 1			: unID = unID +1
		HOTSPOT2 -1,			0, unID, delka_2, 3			: unID = unID +1
		HOTSPOT2 delka_2,		0, unID, delka_2, 2			: unID = unID +1

LINE2 0,0,A*cos(sklon),0
&lt;/PRE&gt;
3D code
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;				HOTSPOT 0,				0,	0,				unID, sklon, 6		: unID = unID +1
				HOTSPOT A,				0,	0,				unID, sklon, 4		: unID = unID +1
				HOTSPOT A*cos(sklon),	0,	A*sin(sklon),	unID, sklon, 5			: unID = unID +1


LIN_ 0,0,0,A,0,0
ROTy -sklon

		HOTSPOT 0,			0,	0,	 unID, delka_3, 1			: unID = unID +1
		HOTSPOT -1,			0,	0,	 unID, delka_3, 3			: unID = unID +1
		HOTSPOT delka_3,	0,	0,	 unID, delka_3, 2			: unID = unID +1



LIN_ 0,0,0,A,0,0
&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:31:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235867#M3964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T11:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the variable</title>
      <link>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235868#M3965</link>
      <description>The logic of your glob_modpar_name statements is saying that the delka_2 value will only change if the last parameter changed was the delka_3, hence it wont respond if you change the sklon value.&lt;BR /&gt;
 to fix this you should do:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;if glob_modpar_name = "delka_2" then
	parameters delka_3 = delka_2/cos(sklon)
	parameters A = delka_2/cos(sklon)
else
	parameters delka_2 = delka_3*cos(sklon)
	parameters A = delka_3
endif
&lt;/PRE&gt;
this way delka_2 always references the delka_3 and sklon values.</description>
      <pubDate>Mon, 11 Jan 2021 21:37:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235868#M3965</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2021-01-11T21:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the variable</title>
      <link>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235869#M3966</link>
      <description>You should also set the values in a local parameter so you don't have to wait for the parameter to update for the 2D and 3D representations to update, like this:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;if glob_modpar_name = "delka_2" then
	delka_3 = delka_2/cos(sklon)
	parameters delka_3 = delka_3
	A = delka_2/cos(sklon)
	parameters A = A
else
	delka_2 = delka_3*cos(sklon)
	parameters delka_2 = delka_2
	A = delka_3
	parameters A = A
endif
&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 21:38:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235869#M3966</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2021-01-11T21:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh the variable</title>
      <link>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235870#M3967</link>
      <description>Personally I would tidy this up to read like this:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;delka_2 = delka_3*cos(sklon)
A = delka_3
parameters 	delka_2 = delka_2,
		A = A
if glob_modpar_name = "delka_2" then
	delka_3 = delka_2/cos(sklon)
	parameters delka_3 = delka_3
endif
&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 21:40:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Refresh-the-variable/m-p/235870#M3967</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2021-01-11T21:40:58Z</dc:date>
    </item>
  </channel>
</rss>

