<?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 Dynamic hotspots in loop and array in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270841#M7847</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi !&lt;BR /&gt;
&lt;BR /&gt;
I need small help in coding. I'm not very good in it so sorry if the question is rather simple.&lt;BR /&gt;
&lt;BR /&gt;
I need to make lines witch are drawn by a loop "FOR 1 TO 5" where each line lenght can be controled &lt;U&gt;&lt;/U&gt;&lt;S&gt;&lt;U&gt;&lt;U&gt;&lt;/U&gt;&lt;/U&gt;&lt;/S&gt;&lt;B&gt;seperately&lt;/B&gt;&lt;E&gt;&lt;/E&gt; by its own hotspot.&lt;BR /&gt;
I managed to make it work so all hotspots show but each of the hostposts control line length of ALL the lines.... but thats not the goal.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;hsid=101
FOR p=1 TO 5
HOTSPOT2 	0, 	0, 		    hsid, lenght, 1+128		: hsid=hsid+1
HOTSPOT2 	0, 	lenght, 	hsid, lenght, 2			: hsid=hsid+1
HOTSPOT2 	0, 	-1, 		   hsid, lenght, 3			: hsid=hsid+1
line2 0,0,0,lenght
add2 3, 0

NEXT p
&lt;/PRE&gt;

I suppose I need to make some sort of an array where each "lenght" is different  but its seems to be in conflict with the "FOR TO" Loop.&lt;BR /&gt;
&lt;BR /&gt;
This does not work:&lt;BR /&gt;

&lt;PRE&gt;DIM lenght[]
hsid=101
FOR p=1 TO 5
HOTSPOT2 	0, 	0, 				hsid, lenght&lt;P&gt;, 1+128		: hsid=hsid+1
HOTSPOT2 	0, 	lenght&lt;/P&gt;&lt;P&gt;, 	hsid, lenght&lt;/P&gt;&lt;P&gt;, 2			: hsid=hsid+1
HOTSPOT2 	0, 	-1, 				hsid, lenght&lt;/P&gt;&lt;P&gt;, 3			: hsid=hsid+1
line2 0,0,0,lenght&lt;/P&gt;&lt;P&gt;
add2 3, 0
NEXT p&lt;/P&gt;&lt;/PRE&gt;
Any ideas  how to get hotspots work seperately in a loop ?&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/68151i09878F14DDBCD225/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Przechwytywanie.JPG" title="Przechwytywanie.JPG" /&gt;</description>
    <pubDate>Thu, 24 Mar 2016 12:18:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-03-24T12:18:25Z</dc:date>
    <item>
      <title>Dynamic hotspots in loop and array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270841#M7847</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi !&lt;BR /&gt;
&lt;BR /&gt;
I need small help in coding. I'm not very good in it so sorry if the question is rather simple.&lt;BR /&gt;
&lt;BR /&gt;
I need to make lines witch are drawn by a loop "FOR 1 TO 5" where each line lenght can be controled &lt;U&gt;&lt;/U&gt;&lt;S&gt;&lt;U&gt;&lt;U&gt;&lt;/U&gt;&lt;/U&gt;&lt;/S&gt;&lt;B&gt;seperately&lt;/B&gt;&lt;E&gt;&lt;/E&gt; by its own hotspot.&lt;BR /&gt;
I managed to make it work so all hotspots show but each of the hostposts control line length of ALL the lines.... but thats not the goal.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;hsid=101
FOR p=1 TO 5
HOTSPOT2 	0, 	0, 		    hsid, lenght, 1+128		: hsid=hsid+1
HOTSPOT2 	0, 	lenght, 	hsid, lenght, 2			: hsid=hsid+1
HOTSPOT2 	0, 	-1, 		   hsid, lenght, 3			: hsid=hsid+1
line2 0,0,0,lenght
add2 3, 0

NEXT p
&lt;/PRE&gt;

I suppose I need to make some sort of an array where each "lenght" is different  but its seems to be in conflict with the "FOR TO" Loop.&lt;BR /&gt;
&lt;BR /&gt;
This does not work:&lt;BR /&gt;

&lt;PRE&gt;DIM lenght[]
hsid=101
FOR p=1 TO 5
HOTSPOT2 	0, 	0, 				hsid, lenght&lt;P&gt;, 1+128		: hsid=hsid+1
HOTSPOT2 	0, 	lenght&lt;/P&gt;&lt;P&gt;, 	hsid, lenght&lt;/P&gt;&lt;P&gt;, 2			: hsid=hsid+1
HOTSPOT2 	0, 	-1, 				hsid, lenght&lt;/P&gt;&lt;P&gt;, 3			: hsid=hsid+1
line2 0,0,0,lenght&lt;/P&gt;&lt;P&gt;
add2 3, 0
NEXT p&lt;/P&gt;&lt;/PRE&gt;
Any ideas  how to get hotspots work seperately in a loop ?&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/68151i09878F14DDBCD225/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Przechwytywanie.JPG" title="Przechwytywanie.JPG" /&gt;</description>
      <pubDate>Thu, 24 Mar 2016 12:18:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270841#M7847</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-24T12:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic hotspots in loop and array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270842#M7848</link>
      <description>Take a look at the 2D script for my framing object. It does exactly this. There is a loop statement in the body of the script with the hotspot controls set in a subroutine.</description>
      <pubDate>Thu, 24 Mar 2016 13:20:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270842#M7848</guid>
      <dc:creator>Erich</dc:creator>
      <dc:date>2016-03-24T13:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic hotspots in loop and array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270843#M7849</link>
      <description>Erich, thank so much !&lt;BR /&gt;
&lt;BR /&gt;
It works ! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
BTW Nice object, thumbs up.</description>
      <pubDate>Thu, 24 Mar 2016 14:19:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270843#M7849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-24T14:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic hotspots in loop and array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270844#M7850</link>
      <description>This is how its done:&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;hsid=hsid+1

i=1

FOR p=1 TO 5 

	GOSUB 100   !!!Hotspots
	line2 0,0,0,lenght&lt;I&gt;
	add2 3, 0
	i=i+1

NEXT p 

END

100:   !!!Hotspots
HOTSPOT2    0,    0,       		hsid, lenght&lt;I&gt;, 1+128     : hsid=hsid+1 
HOTSPOT2    0,    lenght&lt;I&gt;,    hsid, lenght&lt;I&gt;, 2         : hsid=hsid+1 
HOTSPOT2    0,    -1,      		hsid, lenght&lt;I&gt;, 3         : hsid=hsid+1 
RETURN &lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

The key is that the "lenght" parameter requires in the "parameters" a "array values" in a column:</description>
      <pubDate>Thu, 24 Mar 2016 14:24:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270844#M7850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-24T14:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic hotspots in loop and array</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270845#M7851</link>
      <description>&lt;BLOCKQUOTE&gt;philips wrote:&lt;BR /&gt;Erich, thank so much !&lt;BR /&gt;
&lt;BR /&gt;
It works ! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
BTW Nice object, thumbs up.&lt;/BLOCKQUOTE&gt;

Thanks. It has it's uses.</description>
      <pubDate>Fri, 25 Mar 2016 03:29:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Dynamic-hotspots-in-loop-and-array/m-p/270845#M7851</guid>
      <dc:creator>Erich</dc:creator>
      <dc:date>2016-03-25T03:29:06Z</dc:date>
    </item>
  </channel>
</rss>

