GDL
About building parametric objects with GDL.

Draw a circle with hatch

Hello,

I wish to draw a 2D Circle with hatch
CIRCLE and CIRCLE2 do not do that
POLY2 do not do that too
POLY2_ seems to be able to do a circle with hatch but I do not understand this command and the way to get my aim.
POLY2_B{4} n, frame_fill,fill_pen, fill_background_pen,fillOrigoX, fillOrigoY,
mxx, mxy, myx, myy,
gradientInnerRadius,
x1, y1, s1, ..., xn, yn, sn
I am a little afraid about all these parameters 😕
About a 1.5m radius circle with solid hatch what should I write into my 2D script ?
Christophe - FRANCE
Archicad Designer and Teacher
Archicad 15 to 27 FRA FULL

OS 13 Ventura - MacBook Pro M2 max- 32Go RAM
"Quality is never an accident ; it's always the result of an intelligent effort" John Ruskin
6 REPLIES 6
runxel
Legend
While the status codes seem intimidating at first you will become familiar with them. Maybe don't use one of the more sophisticated versions of "poly2". Chances are you don't need those functions anyway.

See the following:

! don't forget to set the general attributes affecting the poly2 command
pen   pen_nr      ! the pen for the contour
line_type  linetype_nr  ! the line type of the contour  
fill  fill_nr     ! the fill type

rad = 1   ! your radius
poly2_b  2,   ! we need two points for a circle
	 1+2  ! status code: show the contour, show the fill
         fill_fg, fill_bg,  ! your fill pens (foreground/background)
         0, 0, 900,  ! first point: the center (status code 900)
         rad, 360, 4000+1  ! second "point", the full circle command, whith radius, the revolution angle, and status code of 4000
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Thanks runxel,

It is a awesome explanations !
I just have to understand what is about these codes 900 and 4000.
Christophe - FRANCE
Archicad Designer and Teacher
Archicad 15 to 27 FRA FULL

OS 13 Ventura - MacBook Pro M2 max- 32Go RAM
"Quality is never an accident ; it's always the result of an intelligent effort" John Ruskin
runxel
Legend
Christophe wrote:
I just have to understand what is about these codes 900 and 4000.
You're welcome.
You should take a deep look into the GDL reference guide. It's thick, sure, but also well explained there.

Those "900" and "4000" are status codes that tell Archicad what to expect.
"900" means, that the point is not part of anything actually, you just set a midpoint for any arcs you draw from now on. It stays "active" as long you don't make another point with the 900 status code.
The "4000" status code is a bit unfortunate imho, since it has two use cases:
For one, you already know that now, it's to make a full circle with the "radius, 360, 4000" notation, the other one is "0, angle, 4000", which makes an arc with the size of "angle". The first parameter is zero, since it serves no use in this particular case.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Hi runxel,

I had read GLD guide before my last post.
Probably GDL guide might be readable for a expert programmer but for me it's like Egyptian hieroglyphs.
I find your explanations even more clear for a beginner like me.

Thanks runxel
Christophe - FRANCE
Archicad Designer and Teacher
Archicad 15 to 27 FRA FULL

OS 13 Ventura - MacBook Pro M2 max- 32Go RAM
"Quality is never an accident ; it's always the result of an intelligent effort" John Ruskin
Barry Kelly
Moderator
Christophe wrote:
Probably GDL guide might be readable for a expert programmer but for me it's like Egyptian hieroglyphs.

Search for the GDL Cookbook by David Nicholson-Cole.
You should be able to find a downloadable PDF that is now free.
It is quite old (around 20 years) but the basics are still great and is well explained.
Has many examples of what you can do and how to do it.
I still refer to it even now.

There should be links to it in this forum as well if you want to do a little searching.


Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Christophe wrote:
Probably GDL guide ... for me it's like Egyptian hieroglyphs.
Barry wrote:
Search for the GDL Cookbook by David Nicholson-Cole.
I'm french, there is a french GDL guide about 15 years ago.
GDL Cookbook or recent GDL Guide are not as understandable for me because of language.
I have to understand 2 languages at the same time by this kind of document : GDL + english
Thanks a lot Barry about these links ! I'm sure I will get my aim soon.
Christophe - FRANCE
Archicad Designer and Teacher
Archicad 15 to 27 FRA FULL

OS 13 Ventura - MacBook Pro M2 max- 32Go RAM
"Quality is never an accident ; it's always the result of an intelligent effort" John Ruskin