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

GDL text that will always be upright or readable!

Anonymous
Not applicable
Im fairly new to GDL and after a bit of help. Ive managed to make some parametric objects with 2d and 3d scripting. One problem i have it that i can't work out how to get my text to auto-rotate so that it is always readable or upright. The text is the right way when i place the object, but as soon as its rotated 180 degrees the text is the upside down. Having objects with upside-down texts drives me crazy.

Any help would be great!
10 REPLIES 10
Anonymous
Not applicable
Jay

What you need is a rot2 for your text inverse to the symb_rotangle (the angle the object is placed on)
You will also need to check if the symbol is mirrored (symb_mirored) and revers the rotation of symb_rotangle again.
Anonymous
Not applicable
Kristian, thanks for replying. I was able to use the symb_rotangle to get the text rotating, but like you mentioned mirroring it becomes a problem where if the symbol gets mirrored the text needs to be rotated back. How exactly do i use the symb_mirored request?

I am still quite a noob to the world of gdl
Laszlo Nagy
Community Admin
Community Admin
In this post you will find some examples for the use of the ROT2 command in GDL, which :

http://blog.cadimage.com/2013/09/gdl-basics-5-using-global-variables/
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
sinceV6
Advocate
Hi.
Check if this works for you:

!===CORRECT TEXT ORIENTATION=====

MUL2 1 - 2 * SYMB_MIRRORED, 1
ROT2 -SYMB_ROTANGLE * (SYMB_ROTANGLE <> 0)

...........................
...........................
(the code part that generates and places your text)
...........................
...........................

DEL 2
Best regards.
Matthew Johnson
Advocate
With the ability to alter the orientation of the plan view we then have the next level of this problem. We model our buildings with the global origin matching the surveyor and then rotate the plan view to display different parts of the building relative to the printed plan.

How do you get an object to respond to the plan orientation?
Matthew Johnson - POWE Architects
AC4.5 --> AC28 & Revit 2016 --> 2023
Asus Zenbook Pro 16x i9-13900H w/ Nvidia RTX 4070 4K dual, Windows 11 64bit + Quest3
I'd rather be sailing.
Laszlo Nagy
Community Admin
Community Admin
I think this is what you are looking for:
nnn = REQUEST ("view_rotangle", "", angleViewRotation)
Returns the rotation angle of the current view.
The above code will load the rotation angle value of the current viewpoint into the angleViewRotation variable.
The nnn variable will contain the value of 1 if the request was successful.

http://helpcenter.graphisoft.com/guides/gdl-guide-for-archicad-18/chapter-12-miscellaneous/request-o...
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
Matthew Johnson
Advocate
Laszlo,

Thanks for that. Works a treat.
Matthew Johnson - POWE Architects
AC4.5 --> AC28 & Revit 2016 --> 2023
Asus Zenbook Pro 16x i9-13900H w/ Nvidia RTX 4070 4K dual, Windows 11 64bit + Quest3
I'd rather be sailing.
Anonymous
Not applicable
Hello,

Hope someone finds this useful, has worked for old objects too...(I think this was found from some GS object years ago).

gdlversion= req("GDL_version")
if gdlversion>1.600 then!--AC13+
	success = request("view_rotangle", "", angleViewRotation)
	SYMB_ROTANGLE = SYMB_ROTANGLE + angleViewRotation
endif
SYMB_ROTANGLE = SYMB_ROTANGLE -((SYMB_ROTANGLE > 360)*360)
textangle= 180*((SYMB_ROTANGLE>90.0001)&(SYMB_ROTANGLE<270.0001))
Anonymous
Not applicable
Hello,

I am pretty much new to GDL codes. I am very visual person than reading the reference guide. It is difficult to understand because i am very fluent with English.

I am trying to create text to be readable in any direction. But for some reason, it didn't do the job. It only read one direction but not other rotation direction.

Can you tell me what I do wrong the code? I included the attachment for you to see it.

I create 3D for GDL objects with no problem but not the 2D drawings that is where I am struggling the most. I am hoping that you can tell me what I did do wrong. Big thanks!!
Screen Shot 2016-09-02 at 1.45.30 PM.png