Adjustable Hotspot for Textblock width
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-23 02:20 PM
Is it possible to add a 2D adjustable hotspot to adjust the width of my textbox?
My text scales with the global scale which is what is causing the issue.
Is there a way to get around this?
Example code for reference:
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 !moveableThanks
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-26 03:49 AM
GDL wrote:
Use the REQUEST ("TEXTBLOCK_INFO", ...) function to obtain information on the calculated width and height of a textblock.
You can then use this value to set your text box.
TEXTBLOCK "papersize1" 0, 7, 0, 1, 1, 0, Label_Length dummy = REQUEST ("TEXTBLOCK_INFO", "papersize1", width) text_offset = width / (1000 / GLOB_SCALE)
That is a segment from one of my objects. In this case,
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-27 10:47 AM
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-27 11:01 AM
I just pulled it from one of my stretchy notes.
You will need a 'length' parameter called "box_wid" and set a default value of say 4000.
And a 'real number' parameter called "text_hgt" with a default value of say 2.0
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
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-27 11:47 AM
Thanks
Windows 10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-28 03:13 AM
JGoode wrote:
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?
Thanks
As in link it to GLOB_SCALE?
DEFINE STYLE "AC_STYLE_1" "Arial", text_hgt * GLOB_SCALE / 1000, 1, 0
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-28 04:33 AM
JGoode wrote:As I understand it, you want the width of the text block to change depending on the scale.
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?
Thanks
The problem there is you are stretching it to a certain width - say 4000mm at a scale of 1:100.
When you change the scale to 1:50 to actually want the width you are stretching to become 2000mm.
So you need to change the value of the stretchy parameter (box_wid) when the scale changes.
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').
box_wid = box_wid*A_/100 PARAMETERS box_wid = box_widBut this won't work as GLOB_SCALE no longer works in the parameter or master script.
You can do the conversion (box_wid = box_wid*A_/100) in the 2D script, but you can not set the parameter value there.
So you are a bit stuck because you can't alter the width parameter based on the scale.
I will have to have a bit of a think about this one.
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.
The idea then is that as you change the scale the box_wid is altered (50/100) i.e. box_wid / 0.5
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-28 05:21 AM
Ling.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-28 05:54 AM
It is that JGoode wants the object to physically change size based on the scale.
When you change the scale, all other elements still measure their original value even though they appear bigger or smaller.
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.
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.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2019-08-28 05:59 AM
I always have separate annotation layers to suit text at different scales.
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.
I would do the same with the note object in this case.
Separate notes for each scale.
Not ideal I know if you need to change the content of the note.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11