We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-08-14 11:03 AM - last edited on 2024-09-24 10:25 AM by Doreena Deng
Is there an explicit tutorial with examples for the GDL other than the gdl reference which does not explain the procedure for novices. I am trying to make my 2D symbol with an editable frame (outline, frame pen, frame background pen). Here is my gdl code but it does not work.
Operating system used: Windows 11
Solved! Go to Solution.
2024-08-15 05:51 PM
POLY2_B will be the command indeed, it should go like this :
pen PC_SdL
fill T_SdL
POLY2_B 9, 1+2,
P_SdL, PF_SdL,
0, 0, 1, ! Point 1
0, var_9 + var_21, 1, ! Point 2
(var_2 + (2 * var_19)), var_9 + var_21, 1, ! Point 3
(var_19 + var_2 + var_19), 0, 1, ! Point 4
var_19+var_2, 0, 1, ! Point 5
(var_19 + var_2 + var_19 - var_20), var_9, 1, ! Point 6
var_20, var_9, 1, ! Point 7
var_19, 0, 1, ! Point 8
0, 0, 1 ! Point 1
2024-08-14 01:19 PM - edited 2024-08-14 03:05 PM
Hello @Camu ,
I made a very simple tutorial a year ago on youtube (shameless plug 😅 : https://www.youtube.com/playlist?list=PL786jdG-2TRfwCaJ8uQgzYs2ynGHTH2Ky). It's really a basic overview of the language in order to create a simple (but functional) table in around 2 hours.
You could also check :
- On this very subforum, there's a pinned thread about Barking Dog's youtube channel
- The GDL Center : https://gdl.graphisoft.com/reference-guide/gdl-guide
- Books like the GDL Cookbook or the GDL Handbook are excellent sources.
I couldn't open your object as I don't have 27 installed but considering what you'd want to do, I believe you should use the POLY2_B command (page 185, in the 2D Shapes chapter) that would allow you to create an object with control over the outline, its fills and pen.
The command goes like this :
pen yourPen
fill yourFill
line_type yourLineType
poly2_b n, 1+2,
yourFillPen, yourBackgroundFillPen,
x1, y1, 1,
x2, y2, 1,
x3, y3, 1,
...
xn, yn, 1
n is the number of nodes which is equal to the number of sides + 1 as the last node is a repeat of the first node. So if you're drawing an hexagon, n would be equal to 7.
2024-08-14 02:12 PM - last edited on 2024-08-15 11:48 AM by Laszlo Nagy
This was my code
! --TRAME--
pen PC_SdL
Fill T_SdL ! Type de trame
! FILL_HOLES_NR P_SdL
POLY2 8, 1+2+4, ! Le deuxième paramètre (1+2+4) est la somme des options pour : 1 (fermeture automatique), 2 (contour tracé), 4 (remplissage)
0, 0, ! Point 1
0, var_9 + var_21, ! Point 2
(var_2 + (2 * var_19)), var_9 + var_21, ! Point 3
(var_19 + var_2 + var_19), 0, ! Point 4
var_19+var_2, 0, ! Point 5
(var_19 + var_2 + var_19 - var_20), var_9, ! Point 6
var_20, var_9, ! Point 7
var_19, 0 ! Point 8
2024-08-14 02:25 PM - last edited on 2024-08-15 04:40 AM by Barry Kelly
Il semble que tu sois francophone. Je veux simplement faire une trame avec la plume de contour éditable, la plume de motif éditable et le fond de motif éditable, mais ça marche pas. quand je fait avec poy2_b il me fait une erreur. si tu as un exemple je suis preneur. Un grand merci à toi d'avoir répondu si rapidement
English only please in this forum.
Translation...
It seems that you are French-speaking. I just want to make a screen with the editable outline pen, the editable pattern pen and the editable pattern fill, but it doesn't work. when I do it with poy2_b it gives me an error. If you have an example I'm interested. Many thanks to you for responding so quickly.
2024-08-14 03:00 PM - last edited on 2024-08-15 04:42 AM by Barry Kelly
Que te dit l'erreur exactement ? Car j'ai rentré ton code avec POLY2 et ça marche de mon côté. Donc soit tu as une erreur de valeur dans tes paramètres, soit tes paramètres ne sont pas des longueurs ou soit tu as un paramètre qui n'est pas trouvé, je pense.
Translation ...
What exactly does the error tell you? Because I entered your code with POLY2 and it works for me. So either you have a value error in your parameters, or your parameters are not lengths or you have a parameter that is not found, I think.
Pour info, il est mieux de répéter le premier noeud car l'équivalent en 3D (prism) n'a pas l'option de fermeture automatique. Donc en général, on fait juste 1+2 et on ajoute le premier noeud en dernier comme ça tu gardes une bonne habitude.
FYI, it is better to repeat the first node because the 3D equivalent (prism) does not have the automatic closing option. So in general, we just do 1+2 and add the first node last so you keep a good habit.
2024-08-14 03:40 PM
Hi,
The poly2_b is not working because you are missing some parameters
You need to add the pens of the fill (yourFillPen, yourBackgroundFillPen)
and also your points must have three values x1,y1,s1, … ,xn,yn,sn
The s1 and sn correspond to this table
Here is your script for a poly2_b
POLY2 9, 1+2, ! Le deuxième paramètre (1+2+4) est la somme des options pour : 1 (fermeture automatique), 2 (contour tracé), 4 (remplissage)
yourFillPen, yourBackgroundFillPen,
0, 0, 15,! Point 1
0, var_9 + var_21,15, ! Point 2
(var_2 + (2 * var_19)), var_9 + var_21, 15,! Point 3
(var_19 + var_2 + var_19), 0, 15,! Point 4
var_19+var_2, 0, 15,! Point 5
(var_19 + var_2 + var_19 - var_20), var_9, 15,! Point 6
var_20, var_9, 15,! Point 7
var_19, 0 , 15,! Point 8
0, 0, 15! Point 9
2024-08-15 02:58 PM - last edited on 2024-08-20 12:20 PM by Laszlo Nagy
2024-08-15 05:51 PM
POLY2_B will be the command indeed, it should go like this :
pen PC_SdL
fill T_SdL
POLY2_B 9, 1+2,
P_SdL, PF_SdL,
0, 0, 1, ! Point 1
0, var_9 + var_21, 1, ! Point 2
(var_2 + (2 * var_19)), var_9 + var_21, 1, ! Point 3
(var_19 + var_2 + var_19), 0, 1, ! Point 4
var_19+var_2, 0, 1, ! Point 5
(var_19 + var_2 + var_19 - var_20), var_9, 1, ! Point 6
var_20, var_9, 1, ! Point 7
var_19, 0, 1, ! Point 8
0, 0, 1 ! Point 1
2024-08-16 07:44 AM
Thank you very much it works. Thanks for your time Thanks for your patience I try to learn this gdl, but there is not much tutorial with real commented example to understand these errors. I wish you a very nice day
2024-08-16 11:58 AM
Glad to know it worked ! Just please mark the subject as solved then so people who encounter a similar issue as yours can find the solution 👍