2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
Wednesday
- last edited
Wednesday
by
Noemi Balogh
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.
Thursday
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
yesterday
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 👍
Wednesday - last edited Wednesday
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.
Wednesday
- last edited
Thursday
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
Wednesday - last edited Thursday 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.
Wednesday - last edited Thursday 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.
Wednesday
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
Thursday
Thursday
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
yesterday
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
yesterday
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 👍