Reply To: Less complex examples

Home Forums About this site Ideas about GDL Center Less complex examples Reply To: Less complex examples

#1483
Frank Studzinski
Participant

Maybe more like this:

! ——————————————————————————
! Input parameters controlled by the user:
! ——————————————————————————
! ZZYZX – (Length) height of the block whose data are displayed

! iTypeTextRotation – (Integer) type of the text rotation:
! 0 – Align with Symbol, 1 – Always Horizontal,
! 2 – Readable

! ——————————————————————————
! Draw the block in 2D
! ——————————————————————————
rect2 0, 0, A, B

! ——————————————————————————
! Define styles
! ——————————————————————————

define style “Style1” “Arial”, 2.5, 1, 0
rrr=request(“Height_of_Style”,”Style1″,theight1)

! ——————————————————————————
! 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

! ——————————————————————————
! Set input data for the text drawing
! ——————————————————————————
! Set the multiplier of the paper scale
PAPER_TO_MODEL = GLOB_SCALE / 1000
! Set text coordinate variable:
! samplesize is given in Paper Size – mm, convert it into Model size – m
! calculate the row height from it,
! therefore the row height will not depend on the font family
dy = – theight1 * 1.5 * PAPER_TO_MODEL
! ——————————————————————————
! Display the texts
! ——————————————————————————
style “Style1” ! Set the previously defined style
text2 0, 0, “Text 1”
text2 0, dy, “Text 2”
text2 0, dy * 2, “Text 3”
text2 0, dy * 3, “Text 4”

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

Graphisoft Berlin GmbH