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

Adding Text rotation to a Custom Object?

rob2218
Enthusiast
how best to do this?
Im sure it's just a line or two I have to add....but not sure where and in what position along the parameters.

thanks,
(see attached).
I just want the ability to be able to rotate the "text" inside the box to any angle I need it.

thanks for you help in advance.

TEXT-PARAMETER-ROTATION-SMALL.jpg
...Bobby Hollywood live from...
i>u
Edgewater, FL!
SOFTWARE VERSION:
Archicad 22, Archicad 23
Windows7 -OS, MAC Maverick OS
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator
I had a look at your object and there are a couple of things you need to do.

Change the text rotation parameter to and 'angle' type variable rather than a real number.


Now use that variable in the TEXTBLOCK command.
You don't need a separate ROT command as I had said before.
I keep forgetting the TEXTBLOCK has a rotation option built into it.


Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

View solution in original post

17 REPLIES 17
Barry Kelly
Moderator
Seems you have asked this before.
Does this help at all?

http://archicad-talk.graphisoft.com/viewtopic.php?p=240617&highlight=rotate+text#240617

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Erich
Booster
Rob,

1. Create an angle parameter for the rotation (let's say you call this ang).

2. Locate the text statement. In your case, this is likely not a TEXT2 command since it appears to be an auto scripted object. More likely it is a RICHTEXT2 statement.

3 Just before the text command, insert a "ROT2 ang" command. This command has a single argument which will be the parameter you created in step 1.

4. Just after the text command, insert a "DEL 1" command to cease the rotation.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
rob2218
Enthusiast
ok, perhaps this is why I was not able to insert it before, cause I had "not a clue" where to even add this text to the script.
TEXT-PARAMETER-ROTATION-script-SMALL.jpg
...Bobby Hollywood live from...
i>u
Edgewater, FL!
SOFTWARE VERSION:
Archicad 22, Archicad 23
Windows7 -OS, MAC Maverick OS
Erich
Booster
You see the RICHTEXT2 statement at the bottom of the script? Add the rotation just before and and DEL just after that command.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Barry Kelly
Moderator
It is the very last line in your image - the 'RICHTEXT2' command.

Because it has x & y co-ordinates included in the command you will want to separate that out as an ADD2 command and then the RICHTEXT2 command.
So effectively you move to the text location and then rotate it.
Otherwise you will be rotating the text around a distant origin.

So change ....
RICHTEXT2 2'-8.9646", 7'-0.0923", "AC_TEXTBLOCK_6"

to ...
ADD2 2'-8.9646", 7'-0.0923"
ROT2 -symb_rotangle 
RICHTEXT2 0, 0, "AC_TEXTBLOCK_6"
DEL 2
This will automatically rotate the text regardless of the object rotation.

Or you could create an angle parameter called "rot_text".
Then change the script to this ...
ADD2 2'-8.9646", 7'-0.0923"
ROT2 rot_text
RICHTEXT2 0, 0, "AC_TEXTBLOCK_6"
DEL 2
This will allow you as the user to change the parameter in the object to rotate the text to any angle you want.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Erich
Booster
Actually, I take that back (a bit). The RICHTEXT2 in your example has an associated movement (the first two arguments) so you will also likely need to move your center of rotation as well. It may serve you best to delete the movement from within the RICHTEXT2 and add it before your new rotation with the ADD2 command and then use DEL 2 rather than DEL 1 so you can cancel both movements (the ADD2 and the ROT2).

If you don't do this, then it is very likely that your rotated text will end up somewhere you don't want it to be.

ed: Barry you just beat me with your example.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Barry or Erich,

I'm having hard time to comprehending this because of English is my second language. I tend to use visual to understand things better such as youtube (some kind of video instruction) or screenshot pointing out where it is error.

I attempted this for so long time and has not been achieve. Can you take look at my screenshot and see what I do wrong. I thought I tried your instruction but it doesn't work? The problem with text itself is disappearing. I was like where it goes. I am not sure.

It'd be nice to have you copy my screenshot and point it out state it is wrong position to place in. I only have been achieve with basic stuff like basic text change like ABC to other ABC. But, I was not able to do rotation properly. I am wondering if I am doing something wrong because I want to be able to achieve text changes or rotation, but I have been achieve with text changes. I really want to beat the rotation to work. Haha.

Here is the screenshot and take look at it and let me know where I do wrong. 😕

Thank you for your time.
Emil Meijer
Graphisoft Alumni
Graphisoft Alumni
cadpg wrote:
let me know where I do wrong. 😕
While I'm far from experienced with GDL myself, I'm guessing it's the last RICHTEXT2 line in the script that overwrites the previously added script for RICHTEXT2 at the top?

Try removing the RICHTEXT2 script at the bottom and see if it helps.
Anonymous
Not applicable
Emil,

Nope, it doesn't solve the problem. Still having error for some reason. The text itself still disappearing.

It'd be nice to have a video to explain how it works with simple text rotation. Sigh.