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

exporting text to autocad, with line breaks preserved

Anonymous
Not applicable
Hi all,

I have a room label which, when exporting to autocad, doesn't preserve its line breaks. a 4-line text block at 1:50, for example, appears in autocad as a single line. Is this a typical problem? normal multiline text blocks seem to export just fine

see the object attached - any help you guys could provide would be greatly appreciated!
7 REPLIES 7
Laszlo Nagy
Community Admin
Community Admin
As far as I can see there are no line breaks in you object. There reason it is written is several lines is because the width of the Text Block is less than the width of the Text written into it so it is placed into several lines.
Why don't you use several RICHTEXT2 commands?
You can use String commands to break down the input text string into 3-4 lines and display each with a RICHTEXT2 command.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
Anonymous
Not applicable
laszlonagy wrote:
As far as I can see there are no line breaks in you object. There reason it is written is several lines is because the width of the Text Block is less than the width of the Text written into it so it is placed into several lines.
Why don't you use several RICHTEXT2 commands?
You can use String commands to break down the input text string into 3-4 lines and display each with a RICHTEXT2 command.
if I understand correctly, would this mean creating a set of input fields rather than having just one? IE I create my own line breaks by inserting the text on different lines? I was trying to stay away from that - hoping that I could have the block output the text just as AC outputs a regular block of text (where the width defines the line breaks). Please let me know if I've misinterpreted
Laszlo Nagy
Community Admin
Community Admin
Yes, this is what I meant.
You could also explicitly define line breaks in your input text by putting \n into it, which is the GDL code for line break.
Let us see if that works.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
Anonymous
Not applicable
laszlonagy wrote:
Yes, this is what I meant.
You could also explicitly define line breaks in your input text by putting \n into it, which is the GDL code for line break.
Let us see if that works.
I had tried that fist actually, but when exporting to autocad format it shows up - certainly not ideal!

I guess the other problem with multi lines is that i have to define their distance above the oval in a way that scales with the drawing scale... seems like it's going to be very complicated

is it a translator issue? is it possible to have the block exploded so that the richtext box shows up just as a text box, instead of being paired with the oval? The intent is mainly to have the line breaks in the right place so that consultant can use them for backgrounds
Laszlo Nagy
Community Admin
Community Admin
Yes, you have to take care of the scaling issue if that is something that is a factor during Translation.
I don't think the Text Block can be broken up because it is one element in ArchiCAD so it is converted to one element in AutoCAD.
You have to write the GDL in a way that produces your desired result.

As I said. what I would do is use one parameter for the text, then use string commands to break it up into several lines of text, then generate those as separate Text Blocks.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
Anonymous
Not applicable
laszlonagy wrote:
Yes, you have to take care of the scaling issue if that is something that is a factor during Translation.
I don't think the Text Block can be broken up because it is one element in ArchiCAD so it is converted to one element in AutoCAD.
You have to write the GDL in a way that produces your desired result.

As I said. what I would do is use one parameter for the text, then use string commands to break it up into several lines of text, then generate those as separate Text Blocks.
and just for clarification (since I'm very new to GDL), when you say to use string commands to break up the text, you mean that I need a separate input line for each line of text, in the object settings? is it a quick enough exercise that you could show me an example of what you mean?
Laszlo Nagy
Community Admin
Community Admin
There would be two ways:
1. Each line of text comes from a different parameter. Maybe this is what you should do because it is the simplest.
2. The whole Text Block comes from one parameter. In this case you would have to have a value of how wide each individual line of text should be and you would have to break up the text coming from the parameter using various string commands. These can be found at page 240 of the GDL Reference Guide (in AC13). So maybe you would have to first calculate how many lines the text would fit depending on the length of the text coming from the parameter. Then you would have to split this into several text parameter and then place these line by line using the TEXT2 command.

Considering all of the above, I would recommend you option 1.
I have no time to give you the code because it is not that simple, sorry.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28