cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:
BIM Coordinator Program (INT) April 22, 2024

# Find the next step in your career as a Graphisoft Certified BIM Coordinator!

GDL
About building parametric objects with GDL.

# Curved Sweep End Angle Not Exactly 90 degrees To Sweep Start Angle

Enthusiast

Hi All,

As the title suggests, I am trying to sweep a circular profile along an arc path, however the sweep end angle is not exactly 90 degrees to the sweep start angle (see image below). I also know that the tube command does something similar, I wanted to know if there is a way to get this to finish at exactly 90 degrees, similar to the way the elbow command does. See code example below:

``````!Variables

!Sweep
sweep 2, 7, 0, 1.1, 1+2+4+8+0+0+0,
0, 0, 901,
0, 0, 0,

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
9 REPLIES 9

I have not worked with this GDL command for a long time, but you may have to change the angle value of the last line from 90 to 75 because your desired value (90) is the bisector angle of you last two values (105 and 75).

AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Hi @Laszlo Nagy  ,

Thanks for your response, this worked, however the divisions of the elbow are no longer equal (see image below). The preference would be to have equal divisions in the sweep similar to an elbow.

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia

I have checked the GDL Reference Guide:

https://help.graphisoft.com/AC/27/INT/GDL.pdf

It says:

``The cross-section at point (xi, yi, zi) is perpendicular to the space curve segment between points (xi-1, yi-1, zi-1) and (xi, yi, zi).``

where

``xi, yi, zi: coordinates of the path curve nodes.``

This is how the cross sections are calculated per my understanding:

So, at each point of the space curve, Archicad will take that point of the space curve, plus the previous point of the space curve, draw a segment between them, and the cross- section will be perpendicular to that segment and will be generated at the end of the segment.

This I think is counterintuitive to what one may think because I for one supposed that the cross section is generated at the midpoint of each segment, not the endpoint. Because of this, I am not sure I can recommend you a way of achieving this using the SWEEP command because if at 90 degrees, you now want to generate a very short horizontal segment, then the result may be that the SWEEP will become self-intersecting.

So, based on these, I would suggest that you try to use the TUBE command to achieve this. With the TUBE command, the cross section is generated at the midpoint of each segment, plus, if we say that the indexes of the path nodes are from Node 1 to Node m, then you also need to define a Node 0 and a Node m+1 of the path, using which you will be able to control the direction of the first and last segment and will be able to achieve your desired geometry, I think.

For detailed info on the TUBE command, check the GDL Reference Guide.

AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Tube solves the problem.

``````TUBE
u1, w1, s1,
...
un, wn, sn,
x1, y1, z1, angle1,
...
xm, ym, zm, anglem``````

same rules as sweep, but your pipe start on x2,y2,z2 and finish on x(m-1), y(m-1), z(m-1),

this calculates the next point of the circle and the tangents for your tap spout...

``````!Variables

!tube
TUBE 2, 9, 1+2+4+8+0+0+0,
0, 0, 901,

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)
Moderator

But a TUBE does not scale each segment smaller or larger as can be done in a SWEEP.

There is TUBEA, but I still don't think that is the same.

Might just need to extend the SWEEP and then cut the end with a cutting plane.

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Expert

Start with 180 degrees, and the first leg should be half of the others. This is a matter of geometry.

``spoutArcRadius+spoutArcRadius*cos(180), 0, spoutArcRadius*sin(180),``
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

I just realized that the very old "ELBOW" command in GDL could also be used for this. It may be the simplest of them all.

AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Thanks Barry, I have done this in the past, it unfortunately seems like the best workaround. Was hoping there would be a better way to achieve this but there doesn’t seem to be.

Cheers!

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia

Hi @Laszlo Nagy ,

Thanks for your assistance in breaking down the GDL reference guide, I really appreciate it. Barry is correct, I am looking for an elbow that scales at both ends. It’s a shame that GDL doesn’t behave consistently across different commands, this makes it difficult to achieve the desired geometry.

The elbow command is great, however doesn’t allow any control over how contours are displayed, so I usually always opt for the tube command.

Cheers!

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia