<?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: GDL: Hotspot Units in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374694#M1032</link>
    <description>&lt;P&gt;Doesn't that just converts the input into meters, so scales the input by 1000. "Units" was probably the wrong word to be using... I am scaling to the Layout, so if the&amp;nbsp;&lt;EM&gt;View&amp;nbsp;&lt;/EM&gt;is 1:50, I need to scale the input by 50, but if it's 1:20, I need to scale it by 20.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2023 01:29:07 GMT</pubDate>
    <dc:creator>Lingwisyer</dc:creator>
    <dc:date>2023-03-29T01:29:07Z</dc:date>
    <item>
      <title>GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374561#M1029</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to scale a parameter used by a dynamic hotspot? My parameters are in &lt;EM&gt;Layout&lt;/EM&gt; units, so they are set to the&amp;nbsp;&lt;EM&gt;View&lt;/EM&gt;, and I would rather not need to make a set of intermediary parameters to convert it for graphical editing...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;paramReference / GLOB_SCALE&lt;/LI-CODE&gt;&lt;LI-CODE lang="cpp"&gt;HOTSPOT2 (marker_length) * GLOB_SCALE,	lsg_elevation,	lsg_uID,	marker_length / GLOB_SCALE,	2+1024	: lsg_uID = lsg_uID +1	!Left moving&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>Wed, 29 Mar 2023 01:38:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374561#M1029</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-29T01:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374593#M1030</link>
      <description>&lt;P&gt;I think the units are tied to the project working unit. As you have suggested the only way round that is with intermediate parameters and using the "displayParam" option in the Hotspot settings.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 08:34:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374593#M1030</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2023-03-28T08:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374602#M1031</link>
      <description>&lt;P&gt;Yes, there is a way: Add '&lt;SPAN&gt;1024&lt;/SPAN&gt;' to the type bitmask. Then the parameter will be measured in paper space (not in model space).&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 12:06:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374602#M1031</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-03-28T12:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374694#M1032</link>
      <description>&lt;P&gt;Doesn't that just converts the input into meters, so scales the input by 1000. "Units" was probably the wrong word to be using... I am scaling to the Layout, so if the&amp;nbsp;&lt;EM&gt;View&amp;nbsp;&lt;/EM&gt;is 1:50, I need to scale the input by 50, but if it's 1:20, I need to scale it by 20.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 01:29:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374694#M1032</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-29T01:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374701#M1033</link>
      <description>&lt;P&gt;It would appear that the reference guide description is inaccurate. 1024 works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Flag 1024: use paramReference value as meters in paper space.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This line in the reference guide should be rewritten as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Flag 1024: scale paramReference value to&amp;nbsp;&lt;EM&gt;View&lt;/EM&gt; scale&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 01:48:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/374701#M1033</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-29T01:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653109#M7463</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I am having a similar problem, but I am not sure this solution works for me (or I am just doing it wrong).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an object that I place into the model space, but it scales itself to paper size. I have 2 pieces (in practice a marker and a text box, but in the example below I just use a line and a box), that I need to be able to adjust compared to each other.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielk_0-1740502104709.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/83630iFEEF1E5202B5F50C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danielk_0-1740502104709.png" alt="danielk_0-1740502104709.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The line and the box are both paper size, so the X/Y distance between them also need to be paper size. All my parameters are floats/real numbers (because the length would be in model space units, and I just want them to be mm).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have an X and a Y parameter, both real numbers in mm, that you can change on the UI, and it moves the box compared to the line. But I just cannot make it work with an editable hotspot. whatever I do, it just won't work...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielk_1-1740502535231.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/83632iF50969E4FAAF0514/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danielk_1-1740502535231.png" alt="danielk_1-1740502535231.png" /&gt;&lt;/span&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;PAPER_TO_MODEL = GLOB_SCALE / 1000
_x = x_paper * PAPER_TO_MODEL
_y = y_paper * PAPER_TO_MODEL

line2 0, 0, 0, 1

add2 _x, _y
rect2 0, 0, 1, 1
del 1

unID = 1
hotspot2 0, 0, unID: unID = unID + 1

hotspot2 0,		_y,	unID, x_paper, 1 + 128	: unID = unID + 1
hotspot2 _x,	_y,	unID, x_paper, 2		: unID = unID + 1
hotspot2 -1,	_y,	unID, x_paper, 3		: unID = unID + 1

hotspot2 _x,	0,	unID, y_paper, 1 + 128	: unID = unID + 1
hotspot2 _x,	_y,	unID, y_paper, 2		: unID = unID + 1
hotspot2 _x,	-1,	unID, y_paper, 3		: unID = unID + 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 17:12:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653109#M7463</guid>
      <dc:creator>danielk</dc:creator>
      <dc:date>2025-02-25T17:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653122#M7464</link>
      <description>&lt;P&gt;Hey Daniel,&lt;/P&gt;
&lt;P&gt;as far as I can tell this does never work if you do not "shadow" the parameters.&lt;/P&gt;
&lt;P&gt;You will need to have the values in both real dimension and millimeters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I call my millimeter one &lt;CODE&gt;x_mm&lt;/CODE&gt; and my real dimension one &lt;CODE&gt;xx&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;Now I tie them together in the Master/Param script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;!// Master/Param script:
if GLOB_MODPAR_NAME = "xx" then 	parameters x_mm = xx*1000
if GLOB_MODPAR_NAME = "x_mm" then 	parameters xx = x_mm/1000&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives me the possibility to do this in the 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="c"&gt;!// 2D script 
line2 0, 0, 0, 1

_x = xx * GLOB_SCALE

add2 _x, 0
rect2 0, 0, 1, 1
del 1
 
unID = 1
hotspot2 0, 0, unID : unID=unID+1

hotspot2 0,		0,	unID, xx, 1+128+1024, x_mm	: unID=unID+1
hotspot2 _x,	0,	unID, xx, 2, x_mm			: unID=unID+1
hotspot2 -1,	0,	unID, xx, 3, x_mm			: unID=unID+1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, why does this work?&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;x_mm&lt;/CODE&gt; will always hold the value in Millimeters. But we need to work with the real dimensions in GDL, so we cannot use that: We need the value in Meters, which is obviously mm times 1000. We sync both values so it does not matter what the user changes, the other value will always be correct.&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;1024&lt;/CODE&gt; always only operates on the 'paramRef' (after the unID). Again, we can only use real dimensions (Meter) in GDL commands, so there is no chance to substitute it here with x_mm. Also there is no flag to reverse from mm to m, only the other way around.&lt;/P&gt;
&lt;P&gt;You obviously want however the user to &lt;EM&gt;show&lt;/EM&gt; the value in Millimeter and enable them to &lt;EM&gt;put in&lt;/EM&gt; a value in mm as well. That's why we use the x_mm as the 'displayParam'.&lt;/P&gt;
&lt;P&gt;And lastly because the '1024' only does its magic when the Hotspot is in use we need to manually go from "xx" to "_x" by multiplying it with GLOB_SCALE and putting it in as the position for the hotspot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not the easiest thing to wrap your head around, I agree! 🫨&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 18:22:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653122#M7464</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2025-02-25T18:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653158#M7466</link>
      <description>&lt;P&gt;Don't only&amp;nbsp;&lt;EM&gt;Length&lt;/EM&gt; parameters get interpreted as mm?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 01:06:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653158#M7466</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2025-02-26T01:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653159#M7467</link>
      <description>&lt;P&gt;Length parameters are shown in whatever working unit you have Archicad set to.&lt;/P&gt;
&lt;P&gt;In GDL they are always interpreted as meters.&lt;/P&gt;
&lt;P&gt;If you use a real number or integer, they will be interpreted as meters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have never tried coding an object for 'imperial' units, so not sure how that works.&lt;/P&gt;
&lt;P&gt;Length units will be in feet/inches, but the code I believe is still meters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 01:15:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653159#M7467</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2025-02-26T01:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653164#M7468</link>
      <description>&lt;P&gt;I was more wondering what the point in using a&amp;nbsp;&lt;EM&gt;Real Number&lt;/EM&gt; parameter together with a&amp;nbsp;&lt;EM&gt;Display &lt;/EM&gt;parameter instead of just using a&amp;nbsp;&lt;EM&gt;Length&lt;/EM&gt; parameter. I do not get this comment...&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;All my parameters are floats/real numbers (because the length would be in model space units, and I just want them to be mm)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 26 Feb 2025 01:27:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653164#M7468</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2025-02-26T01:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653196#M7472</link>
      <description>&lt;P&gt;Oh yes, that is true! Crucial point, I forgot to mention that.&lt;/P&gt;
&lt;P&gt;Flag `1024` is only possible with &lt;EM&gt;Length&lt;/EM&gt; parameters. Another reason why you need two parameters and can't get away with just one (in mm, as float param).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 09:13:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653196#M7472</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2025-02-26T09:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653204#M7473</link>
      <description>&lt;P&gt;This is common practice in objects I have seen before, where you have both Model Size AND Paper Size (like a generic object with text over it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Length parameters are always interpreted as meters in GDL, and on the UI it will display in whatever the user has set for "Working Units" in project preferences. (in my case, I have meters in the model space and millimeters in the paper space)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, in my case, if I made both the dimensions of the objects and the size of the text into "length" parameters, in my case the UI would offer them as meters to the user (because that is the Working Unit in my template), so you would need to enter 1.00 m for the dimension, and 0.001 m for a 1 mm tall text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Things get even more confusing in Imperial templates where text is usually measured in "Points", so you would also need a whole conversion thing there in the code, especially because there is no easy conversion from inches to points like there is from meters to millimeters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, if anyone has a better practice for managing paper units in the model space, I am open to any new ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 10:17:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653204#M7473</guid>
      <dc:creator>danielk</dc:creator>
      <dc:date>2025-02-26T10:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Hotspot Units</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653206#M7474</link>
      <description>&lt;P&gt;Alright, that works like a charm. Thanks so much!&lt;BR /&gt;I tried 10 other ways, using a shadow parameter that didn't work before, never thought to try it this specific way, not very intuitive. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was indeed not easy to get my head around it at first, but I think I get it now. thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 10:30:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Hotspot-Units/m-p/653206#M7474</guid>
      <dc:creator>danielk</dc:creator>
      <dc:date>2025-02-26T10:30:19Z</dc:date>
    </item>
  </channel>
</rss>

