We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Help with fixing some text position

matleonii
Booster
Hey guys, this is the first GDL object I've made and it pretty much worked fine, except for this thing:

I need this 3d object to have a specific 2d representation(it the object to represent electrical fixtures in the plan view), in which each part of it should have a text associated with it.
I've made it in a way that it was possible to move the text around, so that I could position it in the best spot it the plan view and that it would stay in the proportional position in different scales.

I worked fine(as in the fist row of the image)! BUT only as soon as I rotate the object it messed with everything(the second row). The image bellow will show what I mean.



This is the code I used for each one of the texts (1,2 and 3):
! ------------------------------------------------------------------------------
! Text Rotation - Readable / Always Horizontal / Align with Symbol
! ------------------------------------------------------------------------------
r = request ("View_Rotangle", "", _angleViewRot)

! Actual rotation of the 2D symbol:	
_totalRotate	= (SYMB_ROTANGLE + _angleViewRot) MOD 360

! Count the number of transformations of the 
! coordinate system in different cases
_nTrans = 0					  
 
if iTypeTextRotation = 2 then					! Readable
    if (_totalRotate > (90 + EPS) & _totalRotate < (270 + EPS)) then
        rot2 180
        _nTrans = _nTrans + 1
    endif
else
    if iTypeTextRotation = 1 then				! Horizontal
        rot2 _totalRotate * (SYMB_MIRRORED - not(SYMB_MIRRORED))
        _nTrans = _nTrans + 1
    endif
endif

! ------------------------------------------------------------------------------------------------
! Text Position - USING "GLOB_SCALE/50" TO MAKE POSITION THE SAME ON ALL SCALES
! THE "/50" IS BECAUSE I WAS DRAWING ON THE 1:50 SCALE AND NEEDED THING TO BE ON THAT PROPORTIONS
! ------------------------------------------------------------------------------------------------

ADD2 0.06*GLOB_SCALE/50, 0.13*GLOB_SCALE/50

! ------------------------------------------------------------------------------
! MOVABLE HOTSPOTS
! ------------------------------------------------------------------------------

unID=1
!_________________________moving it horizontally
hotspot2 0,verti2,unID,horz2,1+128 : unID=unID+1
hotspot2 -1,verti2,unID,horz2,3 : unID=unID+1
hotspot2 horz2,verti2,unID,horz2,2+256 : unID=unID+1

!_________________________moving it vertically
hotspot2 horz2,0,unID,verti2,1+128 : unID=unID+1
hotspot2 horz2,-1,unID,verti2,3 : unID=unID+1
hotspot2 horz2,verti2,unID,verti2,2+256 : unID=unID+1

DEL 1

! ------------------------------------------------------------------------------
! TEXT ITSELF
! ------------------------------------------------------------------------------

TEXT2 horz2+0.05*GLOB_SCALE/50,verti2+0.1*GLOB_SCALE/50,txti2



! ------------------------------------------------------------------------------
! Delete transformation after Text Rotation
! ------------------------------------------------------------------------------
del _nTrans

Is that a way of getting it right, even when I rotate the object. It is probably something silly, as this is my first GDL project.

Thanks for the time folks! hope some of you can help me with this.
1 REPLY 1
matleonii
Booster
Just something that i thing is important info to find this solution.
When I rotate the object the text remains on the exact same position. I then need to move it to where I want (in this case the position on the original image of the post).