BIM Coordinator Program (INT) April 22, 2024

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

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

GDL Polyline masking problems (again).

Anonymous
Not applicable
I'm having a minor problem getting the smoothing to work reliably on both the circular holes in this prism. It doesn't seem to like having different masking codes to the outer prism boundary. Even if the prism boundary is changed to 79, the problem still happens if you have another rectangular hole with a 15 mask.

Any ideas where I'm going wrong?
PEN 1
MATERIAL 2
RESOL 16

hei = 0.1		! Height
wid = 0.15		! Width
thik = 0.02		! Thickness

!----outline of prism

PUT		0 , 	 0 , 	15,
		wid,	 0 , 	15,
		wid, 	hei, 	15,
		0,		hei, 	15,
		0 , 	 0 , 	-1
	
!!---A rectangular hole

xx=0.1
yy=hei/2


!PUT 	xx,			yy,			15,
!		xx+0.015,	yy,			15,
!		xx+0.015,	yy+0.012,	15,
!		xx,			yy+0.012,	15,
!		xx,			yy,			-1

!!----Two circular holes

!The first circular hole in the sequence doesn't mask properly.

PUT		0.035, 	yy,  	900+79,
		0.015, 	360, 	4000+79	

PUT		0.065, 	yy,  	900+79,
		0.01, 	360, 	4000+79


!!-----Do the prism

PRISM_ nsp/3, thik,	GET (nsp)
15 REPLIES 15
Anonymous
Not applicable
Hi Peter,

I guess this issue must be related to the fact that each hole has to be finalized with a "-1" status code. Try to script both holes with a start node and repeat it with -1 status code in the end of each hole.

Hope this helps.
Anonymous
Not applicable
Hey Braza,

It sounds like you may be right with the -1 status code issue, but I can't seem to get your suggestion to work unfortunately. Would you mind posting an example of a hole with a start (and end) node - I can't visualise what this would look like in code form!
Joachim Suehlo
Advisor
I tested a bit and it seems you have to use code like the autoscripted object do.
Try something like this:

PRISM_     31,      0.1,
				   0,            0,      15, 
				   1,            0,      15, 
				   1,            1,      15, 
				   0,            1,      15, 
				   0,            0,     -1, 

		0.1421712065621, 0.2718219590103,      79, 
		0.2671712065621, 0.2718219590103,    979, 
				   0,          -90,   4079, 
		0.2671712065621, 0.3968219590103,      79, 
		0.2671712065621, 0.2718219590103,    979, 
				   0,          -90,   4079, 
		0.3921712065621, 0.2718219590103,      79, 
		0.2671712065621, 0.2718219590103,    979, 
				   0,          -90,   4079, 
		0.2671712065621, 0.1468219590103,      79, 
		0.2671712065621, 0.2718219590103,    979, 
				   0,          -90,   4079, 
		0.1421712065621, 0.2718219590103,     -1, 

		0.4935412639657, 0.615680201261,      79, 
		0.6185412639657, 0.615680201261,    979, 
				   0,          -90,   4079, 
		0.6185412639657, 0.740680201261,      79, 
		0.6185412639657, 0.615680201261,    979, 
				   0,          -90,   4079, 
		0.7435412639657, 0.615680201261,      79, 
		0.6185412639657, 0.615680201261,    979, 
				   0,          -90,   4079, 
		0.6185412639657, 0.490680201261,      79, 
		0.6185412639657, 0.615680201261,    979, 
				   0,          -90,   4079, 
		0.4935412639657, 0.615680201261,     -1
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
Thanks for checking Joachim.

Seems strange to have to individually do each 90 degree quadrant separately! I will do some playing around to see if I can adapt what I've done already.

I suppose this could be considered a bug, so I'll report it and see what happens.
Anonymous
Not applicable
Peter wrote:
Seems strange to have to individually do each 90 degree quadrant separately!
I've used the 4000 status value with 360° for holes with no problem. Not sure if it makes much difference. I've just always been kind of obsessive about minimizing lines in the script.
Anonymous
Not applicable
Peter,

The mask value of the previous node controls the next node. If you change the mask of the last node of the prism to 79, it works fine. The 4th point (0, hei, 15,) not the 5th point (0, 0, -1)
Anonymous
Not applicable
GDL is a bit tricky (inconsistant?) on this point.

This works in 2D script
!!! ----- 1st hole -----
put 0.035, yy, 900, 
	0.015, 360, 4000+1

!!! ----- 2nd hole -----
put 0.065, yy, 900, 
	0.010, 360, 4000+1 

!!! ----- 3rd hole an up -----
!put 0.095, yy, 900, 
!	0.010, 360, 4000+1 
In 3D script, you must define the first and last points for the first hole,
to get a correct mask (status 4000). Further holes don't need that.
res = 16
resol res

!!! ----- 1st hole -----
put 0.035+0.015, yy, 79,    ! 1st point
	0.035      , yy, 900,      
	0, 360-360/res, 4000+79,
	0.035+0.015, yy, -1     ! closing

!!! ----- 2nd hole -----
put 0.065, yy, 900, 
	0.010, 360, 4000+79  

!!! ----- 3rd hole and up -----
!put 0.095, yy, 900, 
!	0.010, 360, 4000+79 

@ Zsolt : GDL ref guide is inconsistant on this point.
The fifteen years old example which explains the purpose ...
just shows that it doesn't work in the way it is intended for.
Sorry to be the eternal ranter. 😉
Anonymous
Not applicable
Olivier wrote:
In 3D script, you must define the first and last points for the first hole,
to get a correct mask (status 4000). Further holes don't need that.
This gives me the error as the attached image, Olivier. Are you sure it runs on your machine? I'm on AC13 latest hotfix.
Michael wrote:
The mask value of the previous node controls the next node. If you change the mask of the last node of the prism to 79, it works fine. The 4th point (0, hei, 15,) not the 5th point (0, 0, -1)
This almost works, but the last boundary node gets shaded strangely with this method. If you then turn on the rectangular hole (with 15 masks) the circle masking fails again.

However, this gave me the idea of inserting an extra duplicate final node with a mask value of 79 into both the prism and the rectangular hole, and it now seems to work as expected! It's not an ideal solution, but at least it's fairly painless to correct in the script.
hei = 0.1		! Height
wid = 0.15		! Width
thik = 0.02		! Thickness

!----outline of prism

PUT		0 , 	 0 , 	15,
		wid,	 0 , 	15,
		wid, 	hei, 	15,
		0,		hei, 	15,
		0 , 	 0 , 	79,	!!Dummy node with mask
		0 , 	 0 , 	-1
	
!!---A rectangular hole

xx=0.1
yy=hei/2


PUT 	xx,			yy,			15,
		xx+0.015,	yy,			15,
		xx+0.015,	yy+0.012,	15,
		xx,			yy+0.012,	15,
		xx,			yy,			79,	!!Dummy node with mask
		xx,			yy,			-1

!!----Two circular holes

PUT		0.035, 	yy,  	900,
		0.015, 	360, 	4000+79	


PUT		0.065, 	yy,  	900,
		0.01, 	360, 	4000+79

!!-----Do the prism

PRISM_ nsp/3, thik,	GET (nsp)
I appreciate the help guys. I think I can work around the problem with the extra dummy nodes in the rectangular polygons. I wonder if Zsolt could comment on whether this is the way it is meant to work, or if it is a bug?
Anonymous
Not applicable
Peter wrote:
This gives me the error as the attached image, Olivier.
Peter, in your attachment (line 3), this is not the same code as in my example.

Try this
!!! ----- 1st hole -----
put 0.035+0.015, yy, 79,    ! 1st point
	0.035      , yy, 900,      
	0, 360-360/16, 4000+79,    ! 16 is the resolution
	0.035+0.015, yy, -1     ! closing
It works on 12. Don't know for 13.
Learn and get certified!