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

Stretchy text boxes...

Anonymous
Not applicable
Hi guys.... I'm having a confusing time with some GDL....

If I just get some 2D text and create an object it exports to a DWG just fine.... but if I make the box stretchy it looks fine in AC and PM but the moment I export to DWG, the result looks like pooh...

Here is the script I use for my stretchy text box...






DEFINE STYLE{2} "AC_STYLE_1" "Stylus BT", 0.2, 0

PARAGRAPH "AC_PRG_1" 1, 0, 0, 0, 1
PEN 3
SET STYLE "AC_STYLE_1"

"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG, THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.."

ENDPARAGRAPH
TEXTBLOCK "AC_TEXTBLOCK_1" a, 7, 0, 1, 1, 0,
"AC_PRG_1"
RICHTEXT2 0, 0, "AC_TEXTBLOCK_1"
12 REPLIES 12
Frank Beister
Moderator
I would isolate the RICHTEXT passage into a new object. Place this in a plain plan. Start from the scratch new or reduce the richtext specialities of your code an export to DWG after each change to see, what does not work. There are a lot of possibilities to stretch and transform the text to fit it in your box. would be astonished, if this could be exported to DWG.
Try first some most common fonts and sizes. And please post, what makes the trouble. 😉
If you don't want to use RICHTEXT2, you will need to do it with (lots of) TEXT2. Thats very hard, because you can't mix styles inside a text or get automatical wraped text.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Ive spent about 5 hours trying to make a stretchy text box using TEXT2 but simply cannot do it ...



Are there any GS staff here that can shed some light on this situation?
Barry Kelly
Moderator
Nefarious wrote:
Ive spent about 5 hours trying to make a stretchy text box using TEXT2 but simply cannot do it ...



Are there any GS staff here that can shed some light on this situation?
I'm not familiar with richtext as I still use V81.

The stretchy box shouldn't be a problem but stretchy text is.
You will need the object to read through your text breaking it down into individual words using "STRSTR" to find the position of the spaces.
"SUBSTR" can be used to isolate just that word and "STW" used to find the length of that word.
This can then be cummulative for each subsequent word then when the length exceeds that of your stretchy box you have your first line of text.
I haven't actually tried this - just thoughts off the top of my head - but it's a starting point.

I've seen this done by counting the number of characters in text and having a max number of characters per line rather than the length but I guess it could be possible.
In fact there is a string wrapping routine for this in DNC's GDL Cookbook.

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