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

Using text in a GDL object.

toofuerte
Booster
I have tried making objects with text. I have figured how to place it and make a certain point the placement point, but I cannot figure out how to get the text to have the right size and pen #. I am trying to make the object parimetric.... I am making an floor elevation marker and the text goes real huge and has the wrong pen.
Gerald Acton "Gary"
Acton Design Services
Windows 10 PRO 64 bit
i7-5820K @ 3.30ghz 32GB Ram
Nvidia GeForce GTX 1650 4GB Ram
AC 19 - AC 28
3 REPLIES 3
Are you using a plain TEXT2 element? If so,

The pen is set by a PEN directive before the TEXT2.

!! a parameter fuertePen of type pen

PEN fuertePen
TEXT2 x, y, 'Read This'

The size comes from the STYLE definition. Text size is in mm. Typically you'd have a real number parameter (let's say text_pt) for the point size, then convert it.

!! Points to mm
text_size=text_pt/2.8346

DEFINE STYLE 'text_style' text_font, text_size, 5, 0 !center anchor
You can define as many styles as you want. Before placing text of that style you need

SET STYLE 'text_style'
HTH. If you're talking RICHTEXT2 and PARAGRAPH, I would need to review my notes.
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
toofuerte
Booster
Thanks James for the reply. I have been using the text2, by drawing and then dragging from ArchiCAD 2D into the 2Dscript then editing the text to be parimetric, but when I do that it doesn't work the text changes.
Gerald Acton "Gary"
Acton Design Services
Windows 10 PRO 64 bit
i7-5820K @ 3.30ghz 32GB Ram
Nvidia GeForce GTX 1650 4GB Ram
AC 19 - AC 28
Are you on AC9? In 9 dragging text makes a RICHTEXT2, with the attendant PARAGRAPH, TEXTBLOCK, AND DEFINE STYLE{2}.

It's a very roundabout way to place a simple text element. RICHTEXT2 is made from a TEXTBLOCK, which is made from a PARAGRAPH, which uses a STYLE{2}. It's the GDL implementation of the complex text entity which debuted in 9.

If you are doing a simple line of text I would work with STYLE and TEXT2. Just to make it compact, the whole thing is

!! Points to mm 
text_size=text_pt/2.8346 

DEFINE STYLE 'text_style' text_font, text_size, 5, 0 !center anchor

SET STYLE 'text_style'
PEN fuertePen 

TEXT2 x, y, 'Read This'
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info