<?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 Hotspot with integer to drive values{2} list in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579550#M6025</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen hotspots used to drive values{2} lists in the past but can't find the example to show now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to link a variable 'Switch' driven by a values{2} list:&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;values{2} "Switch", 0, `Off`,
                    1, `On`&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;By using a hotspot called 'dragpoint':&lt;/FONT&gt;&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;hsid=hsid+1 
HOTSPOT2 0, 0, hsid, dragpoint, 1+128
hsid=hsid+1 
HOTSPOT2 dragpoint, 0, hsid, dragpoint, 2+512
hsid=hsid+1 
HOTSPOT2 0-1, 0, hsid, dragpoint, 3&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'dragpoint' has a Values Range to snap at 10mm points:&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;VALUES 'dragpoint' RANGE [0.01,0.02] STEP 0.01,0.01&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Then using INT() to make it into an integer, and multiplying to convert 10mm to 1 integer unit so the values list is driven by a 1 or 2:&amp;nbsp;&lt;/FONT&gt;&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;Switch = INT(dragpoint*100000)

PARAMETERS Switch = Switch&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But alas it doesn't play. My hope is to be able to drag a hotspot along snap points to allow selection of a list parameter on the floor plan. Would be very fun.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Many thanks, Matt&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2024 11:33:09 GMT</pubDate>
    <dc:creator>GDL Enthusiast</dc:creator>
    <dc:date>2024-09-26T11:33:09Z</dc:date>
    <item>
      <title>Hotspot with integer to drive values{2} list</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579550#M6025</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen hotspots used to drive values{2} lists in the past but can't find the example to show now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to link a variable 'Switch' driven by a values{2} list:&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;values{2} "Switch", 0, `Off`,
                    1, `On`&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;By using a hotspot called 'dragpoint':&lt;/FONT&gt;&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;hsid=hsid+1 
HOTSPOT2 0, 0, hsid, dragpoint, 1+128
hsid=hsid+1 
HOTSPOT2 dragpoint, 0, hsid, dragpoint, 2+512
hsid=hsid+1 
HOTSPOT2 0-1, 0, hsid, dragpoint, 3&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'dragpoint' has a Values Range to snap at 10mm points:&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;VALUES 'dragpoint' RANGE [0.01,0.02] STEP 0.01,0.01&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Then using INT() to make it into an integer, and multiplying to convert 10mm to 1 integer unit so the values list is driven by a 1 or 2:&amp;nbsp;&lt;/FONT&gt;&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;Switch = INT(dragpoint*100000)

PARAMETERS Switch = Switch&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But alas it doesn't play. My hope is to be able to drag a hotspot along snap points to allow selection of a list parameter on the floor plan. Would be very fun.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Many thanks, Matt&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 11:33:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579550#M6025</guid>
      <dc:creator>GDL Enthusiast</dc:creator>
      <dc:date>2024-09-26T11:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot with integer to drive values{2} list</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579552#M6026</link>
      <description>&lt;P&gt;I have not done it with VALUES{2}, but I often use switch hotspots in my objects.&lt;/P&gt;
&lt;P&gt;Maybe this will help.&lt;/P&gt;
&lt;P&gt;I actually have a boolean on/off parameter and a text parameter for on/off.&lt;/P&gt;
&lt;P&gt;I find the text parameter is clearer for the user in the parameter list of the object.&lt;/P&gt;
&lt;P&gt;Hide one or the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In parameter or master script.&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;swch_dist = 0.075

VALUES "select_hs_swch" "On", "Off"
VALUES "select_hs_yDist" swch_dist, -swch_dist

!!! ---------- show Selector ----------
	if GLOB_MODPAR_NAME = "select_hs_swch" then
		if select_hs_swch = "On" then
			select_hs_yDist =  -swch_dist
			select_hs = 1
		else
			select_hs_yDist = swch_dist
			select_hs = 0
		endif
	endif

	if GLOB_MODPAR_NAME = "select_hs_yDist" then
		if abs (select_hs_yDist-swch_dist) &amp;lt; TOL then
			select_hs_swch = "Off"
			select_hs = 0
		else
			select_hs_swch = "On"
			select_hs = 1
		endif
	endif

	if GLOB_MODPAR_NAME = "select_hs" then
		if select_hs = 1 then
			select_hs_yDist =  -swch_dist
			select_hs_swch = "On"
		else
			select_hs_yDist = swch_dist
			select_hs_swch = "Off"
		endif
	endif

!!! ---------- parameters ----------
	parameters select_hs_swch = select_hs_swch,
				select_hs_yDist = select_hs_yDist,
				select_hs = select_hs
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In 2D script.&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;!!! ---------- show Selector hotspot----------
	HSID=HSID+1
	hotspot2 0.0, 0.0    , HSID, select_hs_yDist, 1    ! base
	HSID=HSID+1
	hotspot2 0.0,0.0-1    , HSID, select_hs_yDist, 3    ! ref
	HSID=HSID+1
	hotspot2 0.0, 0.0+select_hs_yDist, HSID, select_hs_yDist, 2, select_hs_hs_swch    ! moving
	HSID=HSID+1     
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And of course the parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_0-1702095720250.png" style="width: 697px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50275i97821392163C408D/image-size/large?v=v2&amp;amp;px=999" role="button" title="BarryKelly_0-1702095720250.png" alt="BarryKelly_0-1702095720250.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 06:37:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579552#M6026</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-12-10T06:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot with integer to drive values{2} list</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579561#M6027</link>
      <description>&lt;DIV&gt;Hello&lt;/DIV&gt;
&lt;DIV&gt;this little button works in any scale just by clicking the hotspot.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;!Used parameters
!OnOff [2]  (length type)
!on_           (length type)
!off_           (length  type)
!Parameters script
if glob_modpar_name="on_" then
parameters off_=0
parameters on_=.002
endif

if glob_modpar_name="off_" then
parameters on_=0
parameters off_=.002
endif

!2d script:
pos_x=.02
pos_y=-.02
define style"on_off" arial,3,4,0:style"on_off"

scalemultiplier=.0100*glob_scale
circle2 pos_x, pos_y, .5*scalemultiplier

if abs(on_)&amp;lt;.001 then 
insx=pos_x
insy=pos_y
HOTSPOT2 0, insy, id, on_, 1+128 :id=id+1
HOTSPOT2 insx, insy, id, on_, 2 :id=id+1
HOTSPOT2 -1, insy, id, on_, 3 :id=id+1
circle2 pos_x, pos_y, .2*scalemultiplier
circle2 pos_x, pos_y, .1*scalemultiplier
circle2 pos_x, pos_y, .3*scalemultiplier
text2 insx+1*scalemultiplier,insy,"ON"
endif

if abs(off_)&amp;lt;.001 then 
insx=pos_x
insy=pos_y
HOTSPOT2 0, insy, id, off_, 1+128 :id=id+1
HOTSPOT2 insx, insy, id, off_, 2 :id=id+1
HOTSPOT2 -1, insy, id, off_, 3 :id=id+1

text2 insx+1*scalemultiplier,insy,"OFF"
endif&lt;/LI-CODE&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 10 Dec 2023 06:38:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579561#M6027</guid>
      <dc:creator>Pertti Paasky</dc:creator>
      <dc:date>2023-12-10T06:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot with integer to drive values{2} list</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579623#M6028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/14606"&gt;@Pertti Paasky&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;this little button works in any scale just by clicking the hotspot.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Wow, this is really brilliant !&lt;/P&gt;</description>
      <pubDate>Sat, 09 Dec 2023 22:30:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-with-integer-to-drive-values-2-list/m-p/579623#M6028</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2023-12-09T22:30:15Z</dc:date>
    </item>
  </channel>
</rss>

