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

Lamp and Light

Anonymous
Not applicable
Hi. Does anybody know how I can rotate the text in the object light when it's showing in the Floor Plan like a RCP symbol?
Thank you for your help.

Lamp.jpg
13 REPLIES 13
Erich
Booster
giuseppe,

To do this open up the object and save it as a new object preferable to someplace that will be loaded when you need it. In the 2D script look for the variable used for the text (i will call it textparameter but this will not be the name in the part) from the parameters table. You should see something like:

TEXT2 x, y, textparameter

Just before this command you can add a "ROT2 180" command. Follow the TEXT2 command with a "DEL 1". This will essentially flip the text 180 degrees. Better still, add a new rotation parameter to the parameter table and use "ROT2 rotation_parameter" instead of 180. This will allow the user to rotate the text to any desired angle.

You can also go further and allow the text to be rotated so it is upright all the time automatically, or when a Boolean variable is turned on...the options are endless.

HTH
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Thank you so much.
I don't understand why Graphisoft don't do this when they prepare the object, and in general when they create the library.
Thanks again.
Anonymous
Not applicable
Eric, I add the parameter that you told me but there is an error on the script and the new object it is a black spot.
I am sure I made a mistake or I misunderstood what you said.
Please can you be more clear?
Thanks
Erich
Booster
giuseppe,

Which part are you using? Then I can give you the exact change.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Hi! Thanks to be patience, and for my delay on your answer.
The light are:
Wall Lamp 02 12
Wall Lamp 05 12
Halogen Recessed 12
Hanging Lamp 01 12
Recessed Spot 12
Fluorescence Suspended 12
Fluorescence Wall 12
Fluorescence Recessed 01 12
Spot ceiling 12
Chandelier 12
Thanks for your help and for your time
Erich
Booster
giuseppe,

OK, Take a look at the Wall Lamp 02 12 object. The steps to changing the text behavior here are as follows:
1. Select the object in your project.

2. With the object selected open the object. To do this go to File>Libraries and Objects>Open Object. This will open the GDL window.

3. Here look at the parameter table to find the parameter given to the text displayed (image 1).

4. Switch to the 2D script window - click where it says 2D script on the left hand side.

5. Do a Find and Replace to locate the text parameter (choose the whole word option here). Alternately you can do a Find and Replace for the command "text2" (without quotes).
(image 2)

6. This should take you to the following:
text2 txt_pos_x, txt_pos_y, txt
Change this bit of code to the following:
text2 0, 0, txt
(image 3)

7. Just before this line add the following:
ADD2 txt_pos_x, txt_pos_y
		ROT2 rotation
(image 3)

8. Follow the text2 command line with the following:
DEL 2
(image 3)

9. Go back to the parameter table that the object first opened to. Here add the new parameter "rotation" (without quotes). To do this click the NEW button at the top of the GDL window. This will add a new parameter to the bottom of the parameter list. Overwrite the default parameter name with the name rotation.
(image 4)

10. Select the symbol in the TYPE column. You will notice that there is a flippy triangle now. If you click the symbol again you will get a popup chart of parameter types. Select the second symbol for the angle type.
(image 4)

11. Under the NAME column give this new parameter a name that will make sense to the user. This is what you will see when using the part.
(image 4)

12. Save the part under a new name and enjoy the new flexibility of the part.

Here is the first light done for you.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Erich
Booster
Here is the first one.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Erich
Booster
Here is a slight variation that will keep the text upright always when the parameter TxtUp is set to on.
	ADD2 txt_pos_x,txt_pos_y
	IF TxtUp=1 THEN : ROT2 w~*(V~*2-1) : ENDIF 
	text2 0,0,txt
	DEL 1+TxtUp
This is a bit easier to use but less flexible for odd conditions where you perhaps don't want the text all the way upright.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Thank you so much for your help and I will try to modify some of the others objects following your instructions, and I hope I can do it.
Thanks again for you help.