We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Wrap text within an object

JGoode
Expert
Is there a way to wrap text on a 2D object and then making the object expand based on the amount of text inside? How difficult would this be to do?
ArchiCAD 23

Windows 10
3 REPLIES 3
matjashka
Advocate
If I understood your question correctly, the simple answer is yes.

You may have to define your text width first
actualWidth=(your_dimension)*1000
You first create a TEXTBLOCK which has width as one of parameters, and then use RICHTEXT2 do display its contents.
TEXTBLOCK block_name, actualWidth, anchor, angle, width factor, charspace factor, fixed height, "Hello!"
richtext2 0, 0, block_name
Then you use a REQUEST command to acquire the width and height of the above.
your_dimensions = REQUEST("TEXTBLOCK_INFO", block_name, width, height)
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA
JGoode
Expert
matjashka wrote:
If I understood your question correctly, the simple answer is yes.

You may have to define your text width first
actualWidth=(your_dimension)*1000
You first create a TEXTBLOCK which has width as one of parameters, and then use RICHTEXT2 do display its contents.
TEXTBLOCK block_name, actualWidth, anchor, angle, width factor, charspace factor, fixed height, "Hello!"
richtext2 0, 0, block_name
Then you use a REQUEST command to acquire the width and height of the above.
your_dimensions = REQUEST("TEXTBLOCK_INFO", block_name, width, height)
Thanks for the reply! I got it working. Is there a way to set the minimum height?
ArchiCAD 23

Windows 10
matjashka
Advocate
Hi and you're welcome.

If you want to limit values during user input, in the Parameter script you usually do
values "myParam" range[min,]
When dealing with variables you probably want to create some type of a condition like this
min=10
IF myValue<min THEN myValue = min
Of course you can hard code the min or make it a user-accessible parameter.
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA