We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Wallniche side materials

runxel
Legend
What's the secret for having custom surfaces in a WALLNICHE?
The status bit 256 is set, the materials (surfaces) as well, but it changes nothing.
Any insight here?
Lucas Becker | AC 27 on Mac | 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»
7 REPLIES 7
I battled with this initially too. In the end I found you just use the wallniche without the material set for each line and instead set the material before. You can even see in my example where I hid my original material setting.

for k = 1 to vardim1(nodes_x)
	put _nodes_x, _nodes_y, 31	!1+4+8+16, MATWallReveal
next k
material MATWallReveal
wallniche nsp/3, 1, 2+16,
	0,0,1,	0,
	get(nsp)
"MATWallReveal" in this example is a variable determined by either the external and internal wall surfaces or by a custom setting when the user opts to turn the custom setting on.

if bCustRevealMat then
	MATWallReveal	= _iSurfaces[5][1]
	MATWallOpposite = _iSurfaces[6][1]
else
	if WIDO_REVEAL_SIDE then
		if elTYPE = 1 then MATWallReveal	= WALL_MAT_A
		if elTYPE = 1 then MATWallOpposite 	= WALL_MAT_B

	else
		if elTYPE = 1 then MATWallReveal	= WALL_MAT_B
		if elTYPE = 1 then MATWallOpposite 	= WALL_MAT_A
	endif
endif
so simple... once you know.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists
Barry Kelly
Moderator
Funny, I was working on this just last week.
This is what I used.
	
	m1=1	!!the polygon will create a visible edge upon entry into the body being cut
	m2=1	!!depth - the lengthwise edge of the cutting form will be visible
	m3=1	!!the polygon will create a visible edge upon exiting the body being cut
	m4=1	!!outside - the bottom edge of the cutting form will be visible
	m5=1	!!inside - the top edge of the cutting form will be visible
	m7=0	!!controls the viewpoint dependent visibility of the lengthwise edge

	MATERIAL rear_mat
		WALLNICHE 4, 1, 1*0 + 2*0 + 8*0 + 16*1 + 32*0 + 64*0 + 128*0 + 256*1,
		0, 0, 1, 0,
			-(a*0.5),0,1*m1 + 2*m2 + 4*m3 + 8*m4 + 16*m5 + 64*m7,bot_edge_mat,
			(a*0.5),0,1*m1 + 2*m2 + 4*m3 + 8*m4 + 16*m5 + 64*m7,left_edge_mat,
			(a*0.5),b,1*m1 + 2*m2 + 4*m3 + 8*m4 + 16*m5 + 64*m7,top_edge_mat,
			(-a*0.5),b,1*m1 + 2*m2 + 4*m3 + 8*m4 + 16*m5 + 64*m7,Right_edge_mat
The material for the rear of the niche is set with the standard MATERIAL command.
The edges are all controlled in the niche code.

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
Lingwisyer
Guru
Would not the point of 256 be to have each side of the niche independent? Setting a material before hand only allows you to define a uniform side material.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Sorry I was not assuming a different material for each side. I have not needed this yet so haven't tested it.

Barry seems to have it working fine though, and that is with the 256 (+ the 16 also).

Perhaps the issue runxel is witnessing is due to the settings of the mask codes as well.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists
runxel
Legend
Guys, thanks for so much input!
That was very helpful indeed! Glad to have you all here.

I got it sorted out.
So what was the issue here?
First of all, the first status bit j1 cancels the 256 j9 bit!
This is not documented in the GDL manual, and in the german translation I had open the wording is a bit off, so I misinterpreted that the first bit has to be set, while it is in fact the other way around.
Lucas Becker | AC 27 on Mac | 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»
Ahmed_K
Advisor
Oh god, gdl, the BIG SECRET OF ARCHICAD...
How do you learned it please, a 500 page book (gdl cookbook) wont be helpful to implement gdl quickly and use it's power in an office
AMD Ryzen 9 3900X, 32 GB RAM, RTX 3080 10 GB
Archicad 27
Windows 11 professional
https://www.behance.net/Nuance-Architects

Form me, I don't really need to do very many things with .gdl.   So it is a smaller thing to learn how to use a few scripts that I never wrote myself anyway 🙂  .  Mostly is is a matter of just adding a few lines of script to some existing object to get it to do what I want.   

 

ArchiCAD 25 7000 USA - Windows 10 Pro 64x - Dell 7720 64 GB 2400MHz ECC - Xeon E3 1535M v6 4.20GHz - (2) 1TB M.2 PCIe Class 50 SSD's - 17.3" UHD IPS (3840x2160) - Nvidia Quadro P5000 16GB GDDR5 - Maxwell Studio/Render 5.2.1.49- Multilight 2 - Adobe Acrobat Pro - ArchiCAD 6 -25