<?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 Issue incrementing by 1 with combined hotspots in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/675499#M7935</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have this simple rectangle that stretches in two directions. I can use either A and B or in the example, I use an array parameter. I want to know how many resizings I've done with the object so I increment my counter by 1 every time I modify my array.&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;&lt;EM&gt;coords&lt;/EM&gt;&lt;/STRONG&gt; is a length type 1-dimensional array&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;&lt;EM&gt;counter&lt;/EM&gt;&lt;/STRONG&gt; is an integer type parameter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2D is very simple but I have a combined hotspot that causes issues with the incrementation : if I only have one hotspot for X (or for Y) then the increment works fine but if I use a combined hotpost, any change increments the counter by 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;hs = 0

rect2 0, 0, coords[1], coords[2]

! If there is only one hotspot, incrementation is fine
hotspot2	0			, coords[2]	, hs, coords[1], 1 	: hs = hs + 1
hotspot2	coords[1]	, coords[2]	, hs, coords[1], 2 	: hs = hs + 1
hotspot2	-1			, coords[2]	, hs, coords[1], 3 	: hs = hs + 1

! If I add the second one to combine them, I have an issue
hotspot2	coords[1]	, 0			, hs, coords[2], 1	: hs = hs + 1
hotspot2	coords[1]	, coords[2]	, hs, coords[2], 2 	: hs = hs + 1
hotspot2	coords[1]	, -1		, hs, coords[2], 3 	: hs = hs + 1
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code in the Master script&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;isFirstRun	= 0
n = APPLICATION_QUERY ("parameter_script", "firstoccasion_in_progress", isFirstRun)

if isFirstRun and GLOB_MODPAR_NAME = "coords" then
	counter = counter + 1
else
	counter = counter
endif

parameters counter = counter&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use isFirstRun and GLOB_MODPAR_NAME to be sure that the counter is only triggered when I resize. I also tried to check Parameter script runs once in Compatibility Options but to no avail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I directly modify the array in the object's options, then there is no issue whether I have a single or a combined hotspot. But I want the resizing to be dynamic so manually modifying the array is not good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea ?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2025 16:26:57 GMT</pubDate>
    <dc:creator>MF BIM</dc:creator>
    <dc:date>2025-09-02T16:26:57Z</dc:date>
    <item>
      <title>Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/675499#M7935</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have this simple rectangle that stretches in two directions. I can use either A and B or in the example, I use an array parameter. I want to know how many resizings I've done with the object so I increment my counter by 1 every time I modify my array.&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;&lt;EM&gt;coords&lt;/EM&gt;&lt;/STRONG&gt; is a length type 1-dimensional array&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;&lt;EM&gt;counter&lt;/EM&gt;&lt;/STRONG&gt; is an integer type parameter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2D is very simple but I have a combined hotspot that causes issues with the incrementation : if I only have one hotspot for X (or for Y) then the increment works fine but if I use a combined hotpost, any change increments the counter by 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;hs = 0

rect2 0, 0, coords[1], coords[2]

! If there is only one hotspot, incrementation is fine
hotspot2	0			, coords[2]	, hs, coords[1], 1 	: hs = hs + 1
hotspot2	coords[1]	, coords[2]	, hs, coords[1], 2 	: hs = hs + 1
hotspot2	-1			, coords[2]	, hs, coords[1], 3 	: hs = hs + 1

! If I add the second one to combine them, I have an issue
hotspot2	coords[1]	, 0			, hs, coords[2], 1	: hs = hs + 1
hotspot2	coords[1]	, coords[2]	, hs, coords[2], 2 	: hs = hs + 1
hotspot2	coords[1]	, -1		, hs, coords[2], 3 	: hs = hs + 1
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code in the Master script&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;isFirstRun	= 0
n = APPLICATION_QUERY ("parameter_script", "firstoccasion_in_progress", isFirstRun)

if isFirstRun and GLOB_MODPAR_NAME = "coords" then
	counter = counter + 1
else
	counter = counter
endif

parameters counter = counter&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use isFirstRun and GLOB_MODPAR_NAME to be sure that the counter is only triggered when I resize. I also tried to check Parameter script runs once in Compatibility Options but to no avail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I directly modify the array in the object's options, then there is no issue whether I have a single or a combined hotspot. But I want the resizing to be dynamic so manually modifying the array is not good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea ?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 16:26:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/675499#M7935</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2025-09-02T16:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676086#M7947</link>
      <description>&lt;P&gt;No solution ?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":loudly_crying_face:"&gt;😭&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a cube from this for testing and added a 3rd parameter to the combined hotspot and it resulted in incrementations by 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my guess is that the number of impacted parameters in a dynamic hotspot will trigger the same number of runs of the Parameter script ? Hence why I cannot increment it by 1 to calculate the number of modifications ? Am I understanding this right ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, why is directly modifying the 3 values in the array parameter not resulting in the same "issue" ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 09:47:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676086#M7947</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2025-09-08T09:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676332#M7948</link>
      <description>&lt;P&gt;I would guess that when modifying a combined&amp;nbsp;&lt;STRONG&gt;Hotspot&lt;/STRONG&gt;, all of the related parameters are "modified" even if their value does not actually change. So in the original case, your hotspot is modifying both &lt;EM&gt;coords[1]&lt;/EM&gt; and &lt;EM&gt;coords[2]&lt;/EM&gt;, resulting in it triggering your stepper twice. You could try turning off the editting preview as that will prevent most of the scripts running till you release the&amp;nbsp;&lt;STRONG&gt;Hotspot&lt;/STRONG&gt;. I do not currently remember where the setting is off the top of my head...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there really a need to use an array instead of just &lt;EM&gt;coords_x&lt;/EM&gt;, &lt;EM&gt;coords_y&lt;/EM&gt;, &lt;EM&gt;coords_z&lt;/EM&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 01:37:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676332#M7948</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2025-09-10T01:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676445#M7951</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no real need to have an array, I had chosen that way because it was more elegant.&lt;/P&gt;
&lt;P&gt;However even when using single parameters for each coord, the result seems to be the same. I replaced my code with the one below (changed the 2D and 3D accordingly as well) and the increments are by 3 in the 3D view and 2 in the 2D view. So the issue really seems to be stemming from the combined hotspots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;if	isFirstRun 						and \
	(GLOB_MODPAR_NAME = "coords_x"	or \ 
	GLOB_MODPAR_NAME = "coords_y"	or \  
	GLOB_MODPAR_NAME = "coords_z")	then 
	counter = counter + 1
else
	counter = counter
endif
parameters counter = counter&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried to use the GLOB_FEEDBACK_MODE (which I guessed was the variable you hinted at) and it didn't solve this issue either. Neither in the Master script or in the geometric scripts. Maybe what I'm trying to do is not possible or maybe I need to look at the issue from a different perspective&amp;nbsp;because I don't see it at the moment &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 15:43:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676445#M7951</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2025-09-10T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676474#M7952</link>
      <description>&lt;P&gt;Yeah, that was the variable I was thinking of, and being able to query each axis independently, but alas neither worked...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe if you stored the existing value in a hidden parameter for comparison? Even more convoluted, but then you can query if the parameter has actually changed rather than just modified to the same value.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF coords_x_old # coords_x then counter = counter + 1&lt;/LI-CODE&gt;
&lt;P&gt;Probably need an EPS value in there to have it not throw accuracy concerns.&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;</description>
      <pubDate>Thu, 11 Sep 2025 00:48:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676474#M7952</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2025-09-11T00:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue incrementing by 1 with combined hotspots</title>
      <link>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676525#M7954</link>
      <description>&lt;P&gt;Well thanks, it worked&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, what I did was use both &lt;STRONG&gt;coords[]&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;coords_x&lt;/STRONG&gt;, &lt;STRONG&gt;coords_y&lt;/STRONG&gt; and &lt;STRONG&gt;coords_z&lt;/STRONG&gt; but I changed the hotspots' coordinates with &lt;STRONG&gt;coords_x&lt;/STRONG&gt; and &lt;STRONG&gt;coords_y&lt;/STRONG&gt;&amp;nbsp;while keeping the parameter reference with&amp;nbsp;&lt;STRONG&gt;coords[]&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;hotspot2	0			, coords_y	, hs, coords[1], 1 	: hs = hs + 1
hotspot2	coords_x	, coords_y	, hs, coords[1], 2 	: hs = hs + 1
hotspot2	-1			, coords_y	, hs, coords[1], 3 	: hs = hs + 1

hotspot2	coords_x	, 0			, hs, coords[2], 1	: hs = hs + 1
hotspot2	coords_x	, coords_y	, hs, coords[2], 2 	: hs = hs + 1
hotspot2	coords_x	, -1		, hs, coords[2], 3 	: hs = hs + 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then as you suggested I just added a comparison between the coordinates and the param reference and then my increment is now by 1 every time&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 10:19:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Issue-incrementing-by-1-with-combined-hotspots/m-p/676525#M7954</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2025-09-11T10:19:15Z</dc:date>
    </item>
  </channel>
</rss>

