<?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 Adjustable Hotspot for Textblock width in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250620#M2090</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to add a 2D adjustable hotspot to adjust the width of my textbox?&lt;BR /&gt;
&lt;BR /&gt;
My text scales with the global scale which is what is causing the issue.&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to get around this?&lt;BR /&gt;
&lt;BR /&gt;
Example code for reference: 
&lt;PRE&gt;	HSID=1 
	hotspot2 0, 0,HSID, widthx, 1+128     !base 
	HSID = HSID+1 
	hotspot2 -1, 0, HSID, widthx, 3      !reference 
	HSID = HSID+1 
	hotspot2 widthx, 0, HSID, widthx, 2   !moveable &lt;/PRE&gt;

Thanks&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 23 Aug 2019 12:20:01 GMT</pubDate>
    <dc:creator>JGoode</dc:creator>
    <dc:date>2019-08-23T12:20:01Z</dc:date>
    <item>
      <title>Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250620#M2090</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi,&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to add a 2D adjustable hotspot to adjust the width of my textbox?&lt;BR /&gt;
&lt;BR /&gt;
My text scales with the global scale which is what is causing the issue.&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to get around this?&lt;BR /&gt;
&lt;BR /&gt;
Example code for reference: 
&lt;PRE&gt;	HSID=1 
	hotspot2 0, 0,HSID, widthx, 1+128     !base 
	HSID = HSID+1 
	hotspot2 -1, 0, HSID, widthx, 3      !reference 
	HSID = HSID+1 
	hotspot2 widthx, 0, HSID, widthx, 2   !moveable &lt;/PRE&gt;

Thanks&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Aug 2019 12:20:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250620#M2090</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2019-08-23T12:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250621#M2091</link>
      <description>There is no need to do this. If you instead use the &lt;B&gt;Textblock&lt;/B&gt; command, you can then use the request to find the width of the &lt;B&gt;Textblock&lt;/B&gt;.&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;GDL wrote:&lt;BR /&gt;Use the REQUEST ("TEXTBLOCK_INFO", ...) function to obtain information on the calculated width and height of a textblock.&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
You can then use this value to set your text box.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;TEXTBLOCK "papersize1" 0, 7, 0, 1, 1, 0, Label_Length
dummy = REQUEST ("TEXTBLOCK_INFO", "papersize1", width)
text_offset = width / (1000 / GLOB_SCALE)&lt;/PRE&gt;

&lt;BR /&gt;
That is a segment from one of my objects. In this case, &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;text_offset&lt;E&gt;&lt;/E&gt; would be the value for your text box width.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Mon, 26 Aug 2019 01:49:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250621#M2091</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-08-26T01:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250622#M2092</link>
      <description>The issue with this is that I want to be able to set the width of the textbox in plan for text wrapping purposes.</description>
      <pubDate>Tue, 27 Aug 2019 08:47:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250622#M2092</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2019-08-27T08:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250623#M2093</link>
      <description>Try this.&lt;BR /&gt;
I just pulled it from one of my stretchy notes.&lt;BR /&gt;
&lt;BR /&gt;
You will need a 'length' parameter called "box_wid" and set a default value of say 4000.&lt;BR /&gt;
And a 'real number' parameter called "text_hgt" with a default value of say 2.0&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;HOTSPOT2     0.0,     0.0

DEFINE STYLE "AC_STYLE_1" "Arial",text_hgt,1,0



IF symb_mirrored = 1 THEN
	MUL2 -1, 1
	ADD2 -box_wid,0
ENDIF


tab_1 = 0
left_indent = 1

stringval_1 = "Add your note here. You can type what ever you like"

PEN 1


IF symb_mirrored = 0 THEN
	justification = 1
ELSE
	justification = 3
ENDIF

!Define a paragraph
	paragraph "note_1" justification,
		0, left_indent, 0,
		1,
		tab_1

	SET STYLE "AC_STYLE_1"
		"\t" + stringval_1
	endParagraph

!Include the paragraph in a text block

!!TEXTBLOCK name width, anchor, angle, width_factor, charspace_factor, fixed_height,
!!'string_expr1' [, 'string_expr2', ...]

	textBlock "text_block_1" (box_wid*1000/A_),
		7, 0,
		1, 1, 1,
		"note_1"

	rrr = REQUEST("Textblock_Info", "text_block_1", textblockwidth, textblockheight)
	box_hgt = box_hgt + textblockheight*(A_/1000)

!Place the block using the richtext2 command
	richText2 0, 0, "text_block_1"


!stretchy hotspot - note width
	!stretchy hotspot - note width
	hsid=hsid+1 !base
	HOTSPOT2 0,0,hsid,box_wid,1+128
	hsid=hsid+1 !moving
	HOTSPOT2 box_wid,0,hsid,box_wid,2
	hsid=hsid+1 !reference
	HOTSPOT2 -0.0001,0,hsid,box_wid,3

	hsid=hsid+1 !base
	HOTSPOT2 0,box_hgt,hsid,box_wid,1+128
	hsid=hsid+1 !moving
	HOTSPOT2 box_wid,box_hgt,hsid,box_wid,2
	hsid=hsid+1 !reference
	HOTSPOT2 -0.0001,box_hgt,hsid,box_wid,3
	&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 27 Aug 2019 09:01:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250623#M2093</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-08-27T09:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250624#M2094</link>
      <description>This definitely works and I had tried it but is there any way to make the text maintain the same shape when scale is changed? &lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Tue, 27 Aug 2019 09:47:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250624#M2094</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2019-08-27T09:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250625#M2095</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;
This definitely works and I had tried it but is there any way to make the text maintain the same shape when scale is changed? &lt;BR /&gt;
&lt;BR /&gt;
Thanks
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
As in link it to &lt;B&gt;GLOB_SCALE&lt;/B&gt;?&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;DEFINE STYLE "AC_STYLE_1" "Arial",	text_hgt * GLOB_SCALE / 1000,	1,	0&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 28 Aug 2019 01:13:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250625#M2095</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-08-28T01:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250626#M2096</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;
This definitely works and I had tried it but is there any way to make the text maintain the same shape when scale is changed? &lt;BR /&gt;
&lt;BR /&gt;
Thanks
&lt;/BLOCKQUOTE&gt;

As I understand it, you want the width of the text block to change depending on the scale.&lt;BR /&gt;
The problem there is you are stretching it to a certain width - say 4000mm at a scale of 1:100.&lt;BR /&gt;
When you change the scale to 1:50 to actually want the width you are stretching to become 2000mm.&lt;BR /&gt;
So you need to change the value of the stretchy parameter (box_wid) when the scale changes.&lt;BR /&gt;
&lt;BR /&gt;
This poses a problem because you could just add something like this to the master or parameter script (I have used 'A_' instead of 'GLOB_SCALE').&lt;BR /&gt;

&lt;PRE&gt;box_wid = box_wid*A_/100
PARAMETERS box_wid = box_wid&lt;/PRE&gt;

But this won't work as GLOB_SCALE no longer works in the parameter or master script.&lt;BR /&gt;
&lt;BR /&gt;
You can do the conversion (box_wid = box_wid*A_/100) in the 2D script, but you can not set the parameter value there.&lt;BR /&gt;
&lt;BR /&gt;
So you are a bit stuck because you can't alter the width parameter based on the scale.&lt;BR /&gt;
&lt;BR /&gt;
I will have to have a bit of a think about this one.&lt;BR /&gt;
&lt;BR /&gt;
P.S. 'A_/100' will simply give a value of 1 (100/100) so that at 1:100 scale the object appears exactly the width you want.&lt;BR /&gt;
The idea then is that as you change the scale the box_wid is altered (50/100) i.e. box_wid / 0.5&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 28 Aug 2019 02:33:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250626#M2096</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-08-28T02:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250627#M2097</link>
      <description>Could you just display a &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;print width&lt;E&gt;&lt;/E&gt; for the textbox width instead with this variable being one that is defined in the 2D script and references &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;your box_wid&lt;E&gt;&lt;/E&gt; variable? Or does the &lt;B&gt;displayParam&lt;/B&gt; need to be in your parameters list?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 28 Aug 2019 03:21:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250627#M2097</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-08-28T03:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250628#M2098</link>
      <description>I don't think the problem is the display value for the hotspot.&lt;BR /&gt;
It is that JGoode wants the object to physically change size based on the scale.&lt;BR /&gt;
&lt;BR /&gt;
When you change the scale, all other elements still measure their original value even though they appear bigger or smaller.&lt;BR /&gt;
Which is what my original note does - it stays the same with, but because the text scales (stays the same printable size), you can fit more characters in the same width box - the height will adjust automatically based o the width of the text.&lt;BR /&gt;
&lt;BR /&gt;
JGoode wants (I believe) the width of the text block to reduce with the scale to effectively keep the text box looking as it was before - i.e all the line returns in the same place.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 28 Aug 2019 03:54:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250628#M2098</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-08-28T03:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250629#M2099</link>
      <description>As with standard text, I would not display the same text at different scales.&lt;BR /&gt;
I always have separate annotation layers to suit text at different scales.&lt;BR /&gt;
It may say the same thing but its position and size will change according to the scale - so I will always duplicate the note for each scale so they can be adjusted separately.&lt;BR /&gt;
&lt;BR /&gt;
I would do the same with the note object in this case.&lt;BR /&gt;
Separate notes for each scale.&lt;BR /&gt;
Not ideal I know if you need to change the content of the note.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 28 Aug 2019 03:59:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250629#M2099</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-08-28T03:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable Hotspot for Textblock width</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250630#M2100</link>
      <description>&lt;PRE&gt;If _ViewScale = 0 then
		View_Scale = 1
	else
		View_Scale = GLOB_SCALE
endIf



mul2 View_Scale, View_Scale&lt;/PRE&gt;

&lt;BR /&gt;
Not sure how that works with editable hotspots though...</description>
      <pubDate>Wed, 28 Aug 2019 04:58:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Adjustable-Hotspot-for-Textblock-width/m-p/250630#M2100</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-08-28T04:58:49Z</dc:date>
    </item>
  </channel>
</rss>

