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

2D Tube - GDL code

Anonymous
Not applicable
I´am trying to make a 2D Tube object on a basis of an existing object (drainage line 10.gsm). I have problems with the start and end position of the contour lines on both side of the axis line (they must follow axis line if it´s end position is streched and angled wit use of it´s end point hotspot on Plan View).
3 REPLIES 3
Anonymous
Not applicable
I suppose the answer will depend on how you have coded the extra lines!!

In the original object there is only one hotspot to move/rotate the line on the end point. How did you rotate it to produce the middle image?

Can you post an extract of the code, or even the whole object?
Anonymous
Not applicable
Peter wrote:
I suppose the answer will depend on how you have coded the extra lines!!

1. In the original object there is only one hotspot to move/rotate the line on the end point. How did you rotate it to produce the middle image?

2. Can you post an extract of the code, or even the whole object?

Thank you Peter for your help. In meantime I found the solution. Just a little trigonometry formula and now IT WORKS!

Answers on your questions:
1. With that hotspot on the end point yuo can stretch (shorten or lenghten) AND rotate the line at the same time. The middle image....I just rotate the object through the start point.

2. I post the object (advise....most of the UI an parts of the code is in slovene langueage. I must translate it back in english).

Now I have another problems:
3. Problem 2....In UI (Parameters) - GDL code, it is not possible to input a sign for diameter (ALT+0216), or am I missing something? The same when I use the object and try to insert that character.

4. Using the object (input values for SLOPE - in %, and TEXT HIGHT). That values change if I change "WORKING UNITS" in the menu Options. My default
units are "cm", so I insert 1 for Slope, and that value must be the same if I change to "mm" or "m"!!. But it´s not so. I see this values:
Working Units Slope - % Text Hight
mm 10 2
cm 1 0.2
m 0.01 0,002



There´s a part of the code to make those lines:

! ---------- Drainage Line (Stretchy Line_OD) - 2D SCRIPT
! Stretchy Line
gosub 100 ! Hotspots
gosub 200 ! Line
gosub 300 ! Text
END ! End the routine
100 : !!! ========== Hotspots ==========
uid = 1
hotline2 x[1], y[1], x[2], y[2]
hotspot2 x[1], y[1] ! start point
!!! ----- move in x direction -----
hotspot2 0 , y[2], uid, x[2], 1+128 : uid = uid+1 ! base
hotspot2 -1 , y[2], uid, x[2], 3 : uid = uid+1 ! ref
hotspot2 x[2], y[2], uid, x[2], 2 : uid = uid+1 ! move
!!! ----- move in y direction -----
hotspot2 x[2], 0 , uid, y[2], 1+128 : uid = uid+1 ! base
hotspot2 x[2], -1 , uid, y[2], 3 : uid = uid+1 ! ref
hotspot2 x[2], y[2], uid, y[2], 2 : uid = uid+1 ! move
add2 xx, yy
hotspot2 0, 0, uid : uid = uid+1 ! centre (deplacement)
del 1
return

200 : !!! ========== Line - AXE ==========
pen penLine
line_type ltLine
line2 x[1], y[1], x[2], y[2]

!! ========== Lines - OUTER CONTOUR ==========
x[3] = x[1] - (SIN(ang) * fiCevi/2) !!left line
y[3] = y[1] + (COS(ang) * fiCevi/2) !!ang....see Master Script
x[4] = x[2] - (SIN(ang) * fiCevi/2) !!fiCevi= diameter in English
y[4] = y[2] + (COS(ang) * fiCevi/2)

x[5] = x[1] + (SIN(ang) * fiCevi/2) !!right line
y[5] = y[1] - (COS(ang) * fiCevi/2)
x[6] = x[2] + (SIN(ang) * fiCevi/2)
y[6] = y[2] - (COS(ang) * fiCevi/2)

pen robPen
line_type robLine
line2 x[3], y[3], x[4], y[4]
line2 x[5], y[5], x[6], y[6]

return
Anonymous
Not applicable
A few things more to do and change in the GDL code:
Tube 2D_Fi_Arrow.jpg