BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.
SOLVED!

Problems with TEXT2

Otavio Augusto
Certified Trainer

Hello, I'm trying to create an electrical object symbol following the standards of our office, but when writing the 2D drawing script, the TEXT2 command is not respecting the created DEFINE STYLE directive. Does anyone have an idea of why this might be happening?

It's a very simple drawing that is almost ready, I just need to get the text to respect the created style so that the text stays within the 2D drawing.

Below is the line of code referring to the problem with TEXT2 and DEFINE STYLE.

 

!TESTE FORMA iExample = 4 | ALGUM ERRO EM DEFINE STYLE
if iExample = 4 then
	circle2 0, 0, radius2
	circle2 0, 0, radius1
	HOTARC2 0, 0, radius2, 0, 360
	DEFINE STYLE "3" "Calibri", 0.5, 5, 0
	text2{3} 0,0, "TV"
endif

 


i'm sorry if i didn't post in the right forum.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Kevin Lee
Enthusiast
circle2 0, 0, radius2
circle2 0, 0, radius1
HOTARC2 0, 0, radius2, 0, 360
 
DEFINE STYLE 'labeltext' "Calibri",0.5,5,0
SET STYLE 'labeltext'
 
text2 0,0, "TV"

------------------

The above define style and set style will work but i recommend below:

 

TEXT_SIZE = TEXT_SIZE *(100/GLOB_SCALE).   : redefine the text size to suit the drawing scale

 

DEFINE STYLE "AAA" fonttype, TEXT_SIZE, 1, 0

SET STYLE "AAA"

TEXT2 0, 0, "TV"

 

*Recommend adding the parameters over set font type and size in the script. see the sample below.

 

 


Screenshot 2023-04-20 at 10.48.44 am.png
Kevin Lee

Director of Technology | BIM

TZG Architects

View solution in original post

5 REPLIES 5
LeeJaeYoung
Virtuoso
DEFINE STYLE "3" "맑은 고딕", 0.5, 5, 0
style "3"
text2 0,0, "가자TV"
 
LeeJaeYoung_0-1681946901806.png

 

You just defined the font, but didn't set it up for use. And text{2} is a command I don't know, so I tested it by changing it.
 
AC27 on window 11

LeeJaeYoung_0-1681947270726.png

 

I try to reload it to reflect the changes I made. There are times when you can't do this...

AC27 on window 11
Solution
Kevin Lee
Enthusiast
circle2 0, 0, radius2
circle2 0, 0, radius1
HOTARC2 0, 0, radius2, 0, 360
 
DEFINE STYLE 'labeltext' "Calibri",0.5,5,0
SET STYLE 'labeltext'
 
text2 0,0, "TV"

------------------

The above define style and set style will work but i recommend below:

 

TEXT_SIZE = TEXT_SIZE *(100/GLOB_SCALE).   : redefine the text size to suit the drawing scale

 

DEFINE STYLE "AAA" fonttype, TEXT_SIZE, 1, 0

SET STYLE "AAA"

TEXT2 0, 0, "TV"

 

*Recommend adding the parameters over set font type and size in the script. see the sample below.

 

 


Screenshot 2023-04-20 at 10.48.44 am.png
Kevin Lee

Director of Technology | BIM

TZG Architects

yessss, thanks so much!
how could i miss it...

 

but the obvious is only obvious when you know it right? lol


@Otavio Augusto wrote:

but the obvious is only obvious when you know it right? lol


Obviously. 🤣

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Learn and get certified!