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

"RICHTEXT" and "TEXTBLOCK"

TomWaltz
Participant
Has anyone seen or used these new GDL commands yet?

I saw them in the GDL Manual, but could not find any trace of them in the object library.

I was hoping to find a little more context or application for them. I would love to think that RICHTEXT could have a use in making Zones appear in sections (if there was a 3D script in Zones.....)
Tom Waltz
12 REPLIES 12

TEXTBLOCK, which must be used with RICHTEXT/RICHTEXT2, and is made very powerful by, but doesn't require, PARAGRAPH, allows you to control the width, character spacing, and width factor of text.

This new element provides several of the new attributes of the improved AC9 text element, and the PARAGRAPH command provides the rest, ie, the ability to switch styles in midstream. PARAGRAPH also allows you to concatenate strings greater than 255 characters into one element, maybe it would help with your other string question?

RICHTEXT/2 places the text. TEXTBLOCK defines the text "shape" (position, spacing, angle, width), and content. The content can be a regular string, like with TEXT2, or it can be a previously defined PARAGRAPH. TEXTBLOCK doesn't place text on its own.

The PARAGRAPH can contain an arbitrary number of strings, switching pens and styles willy-nilly along the way.

It seems to me like a lot of commands to deploy the new attributes, but what do I know. The width control is most welcome.

Here's some script:
! 2D SCRIPT

txtsz=txtpt/2.8346 !Points to mm
DEFINE STYLE 'sty1' 'Arial',txtsz,5,0
DEFINE STYLE 'sty2' 'Times',txtsz*0.8,5,2
DEFINE STYLE 'sty3' 'Times',txtsz*1.1,5,3


PARAGRAPH "par1" 1, 0, 0, 0, 1.0, 1.0
	PEN 52
	SET STYLE "sty1"
	"At last, passage paid, and luggage safe, we stood on board the schooner. " "Hoisting sail, it glided down the Acushnet river. " 
	PEN 42
	SET STYLE "sty2"
	"On one side, New Bedford rose in terraces of streets, their ice- covered trees all glittering in the clear, cold air. " 
	PEN 32
	"Huge hills and mountains of casks on casks were piled upon her wharves, " 
	"and side by side the world-wandering whale ships lay silent and safely moored at last; "
	"while from others came a sound of carpenters and coopers, " 
	"with blended noises of fires and forges to melt the pitch, "
	"all betokening that new cruises were on the start; "
	"that one most perilous and long voyage ended, only begins a second; "
	"and a second ended, only begins a third, and so on, for ever and for aye. " 
	SET STYLE "sty3"
	"Such is the endlessness, yea, the intolerableness of all earthly effort."
ENDPARAGRAPH

TEXTBLOCK "block1" 100, 1, 0, 1.0, 1.0, 1, "par1"

RICHTEXT2 0,0, "block1"
Mind the quote marks.

The 2D view is attached.
paragraph.jpg
James Murray

Archicad 25 • Rill Architects • macOS • OnLand.info

A couple of bugs in the new text commands:

In TEXTBLOCK, if a string or a string variable is used for the content argument, the resulting RICHTEXT element is doubled in height, making it hard to manage its placement. If a PARAGRAPH is used, the height is correct.

PARAGRAPH doesn't fully accept string variables, only actual strings. If a variable is used, the content displays correctly, but the style and pen are not applied.

So, trying to build a RICHTEXT from a string variable:

TEXTBLOCK doesn't work because using the variable messes up the height.

PARAGRAPH -> TEXTBLOCK doesn't work because using the variable messes up the style.

If I code around the height problem and then GS fixes it, it will fry all the placed instances unless I update my code simultaneously. Um, no.

With these issues, the commands appear useless for anything other than modeling pages of books. Unless I'm missing something.

Rather than post a bunch of code bits and screenshots, here's an object that shows the problems.
James Murray

Archicad 25 • Rill Architects • macOS • OnLand.info

Anonymous
Not applicable
Work around... see below.
Allows variable text in paragraph definition.

PARAGRAPH "AAAAAA" 2, 1, 1, 1, 1
SET STYLE{2} "znamestyle"
PEN ZONAPEN

"" + ROOM_NAME
ENDPARAGRAPH

TEXTBLOCK "BBBBBB123" tbWidth, 8, 0, 1, 1, 1,
"AAAAAA"

RICHTEXT2 0", 0", "BBBBBB123"

STYLE{2} is the key. Thanks for the clue. I wouldn't call it a workaround; it's just what you have to do! The manual says its 'recommended' for use with PARAGRAPH. I would amend that to 'required'. And you can't use the same style def for plain TEXT2s, because of the anchor argument. It seems we will need redundant style definitions in some cases. I won't complain, if I can get PARAGRAPH to give me complex, plain language, multiline, correctly aligned labels. Back to work...
James Murray

Archicad 25 • Rill Architects • macOS • OnLand.info

Joachim Suehlo
Advisor
You can check the new syntax too if you drag and drop a peace of text with different styles and colors into the 2d-script of a new object.
Joachim Suehlo . AC12-26 . MAC OSX 10.15 . WIN10
GDL object creation: b-prisma.de | the MVO driven zone stamp: flexi-zone-stamp

Laura Yanoviak
Advocate
Can anyone help me with the following?
MUL2 A_,A_

PEN 18
DEFINE STYLE TEXT_1 gs_text_font,2.38,3,1

SET STYLE TEXT_1
TEXT2 0,0,"01100 - "

DEFINE STYLE TEXT_2 gs_text_font,2.38,1,0

SET STYLE TEXT_2
TEXT2 0,0,note

IF add_desc THEN

DEFINE STYLE{2} TEXT_3 gs_text_font,2.38,0
PARAGRAPH "PARA" 1,0,0,0,1
SET STYLE{2} TEXT_3
desc_1
ENDPARAGRAPH

TEXTBLOCK "block1" 40,1,0,.8,1,1,"PARA"
RICHTEXT2 0,-0.004,"block1"
endif

END
I'm trying to create a CSI note that will allow a custom multi-line descriptor below the standard text (in this case, desc_1="Additional Descriptor(s) Here"). I can't seem to control the height of the descriptor text -- what am I doing wrong?

Any help would be very much appreciated -- LJY
MacBook Pro Apple M2 Max, 96 GB of RAM
AC26 US (5002) on Mac OS Ventura 13.5

Anonymous
Not applicable
Laura wrote:
I can't seem to control the height of the descriptor text -- what am I doing wrong?
Hallo Laura,
nothing wrong in your script. Just as James already has described above, due to bug Styles for variables don't work in PARAGRAPH -> TEXTBLOCK.
I have tested that not only for strings in GDL Scripting dilaog, but also for imported from external file strings. The last also don't help in this case. So you have to use other GDL commands!

P.S.: What a nice slavic surname?

Laura Yanoviak
Advocate
Thanks -- good to know prior to creating the 100 or so objects we'll need for our CSI note library.

Yes -- my grandparents came to this country from Slovakia...
MacBook Pro Apple M2 Max, 96 GB of RAM
AC26 US (5002) on Mac OS Ventura 13.5

F_ Beister
Enthusiast
@Laura if she is listening or someone else:

Where is SET STYLE{2} from? It is not described in the manual. After the syntax rules it means, that it's a second version of SET STYLE, but it's not described in the manual. What's the difference? Should it be used in RICHTEXT/PARAGRAPH-Context?

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!