cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Starting August 6, 2024, TLS 1.2 will be the minimum required protocol version for Graphisoft products and services that require an online connection. License Manager Tool update is required on Windows. Learn more…
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

REQUEST object width and height

jakubc7
Advocate
Sorry if this has already been asked previously but I did look and couldn't find an answer.

I'm trying to draw a box/frame (POLY2_B) around text based object. I can do a bad job using this sort of script:

!!!Request text height of style and name it
x=REQUEST('Height_of_Style','arialbold_2',arialbold_h)

!!!Specify the width and height of text
txt_w=STW(txt_areas) / 1000 * GLOB_SCALE
txt_h=arialbold_h / 1000 * GLOB_SCALE

It's not quite working for me because the width of my box is dictated by width of the text string, which is not always the longest piece of text.

I want to REQUEST the width and height (x and y) of my object and base the polyline/frame around it. Any advice???

Jakub
ArchiCAD 10 - 25 | Windows 10
ARCHIcreate | Perth, Western Australia
archicad solutions | content creation | training | software implementation
2 REPLIES 2
Barry Kelly
Moderator
Sounds like you are on the right track.
You just need to determine the length of the longest text string (as you have done for "txt_areas" already.
If you have more than one text string then find out what the length of each string is and then determine which one is longer.
You could use ... box_wid = MAX (txt_w_1, txt_w_2, ... txt_w_n) ... to do this, where "txt_w_1" etc. are the widths of each of your text strings.

It won't matter what text values are typed in for each of your text parameters by the user as this will determine which is the longest.


You can also set a minimum known length so you box can never be less than a certain size.
i.e. MAX (3.25, txt_w_1, txt_w_2, ... txt_w_n)

Barry.
One of the forum moderators.
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
jakubc7
Advocate
Thanks for the reply Barry. That worked perfectly.
ArchiCAD 10 - 25 | Windows 10
ARCHIcreate | Perth, Western Australia
archicad solutions | content creation | training | software implementation