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

GDL
About building parametric objects with GDL.

PROJECT2{4} syntax

Anonymous
Not applicable
I would like to create a 2D representation cutting through the 3D geometry of my GDL object. Is there a simple example available anywhere of the syntax for this? The example on the Archicad site with the contours is overly complex. Where I believe I am getting hung up is the requirement for a single cut plane to also have a 'non cutting' view. The interactivity between the unsliced and sliced objects is extremely confusing to me. For instance, if I set the unsliced object method to 3 and the sliced object method to 2 it nearly works. (I just need control of the fills of what is being sliced.) But if I change the method settings of the unsliced object to anything other than 3 the sliced portions disappear. My current code is attached below.
Thanks, Luke
		PROJECT2{4} 3,  			! projection_code = 3 (top view), 
			270,					! angle = 270
			1, 					! useTransparency = off, 
			1+2,					! statusParts = 1 + 2 (all parts)
			1,					! number of cutplanes (can be 0 but 1 or more preferred)
			18", 				! cutplane height

								! UNSCLICED OBJECTS ONLY (VIEWED FROM TOP)
			3,  					! method (0 = hidden, 1 = wireframe, 2= hidden lines, 3 = shading)
			1+2+4+8+16+32,		! parts to generate
			2,					! cut fill index 
			1, 					! cut fill pen
			-1, 					! cut fill background pen
			0.0,					! cut fill origin x,
			0.0,					! cut fill origin y
			0.0,					! cut fill direction angle
			1, 					! cut line pen
			1, 					! cut line type
			2,					! projected fill index 
			247, 				! projected fill pen
			121, 				! projected fill background pen
			0.0,					! projected fill originsx,
			0.0,					! projected fill origin y
			0.0,					! projected fill direction
			248, 					! projected line pen
			1, 						! projected line type
	
								! SLICED OBJECT
			2 + 16 + 32 + 128 + 4096,! method (1 = wireframe, 2= hidden lines, 3 = shading)
			1+2+4+8+16+32,		! parts to generate  			
			2,					! cut fill index 
			245, 				! cut fill pen
			245, 				! cut fill background pen
			0.0,					! cut fill origin x,
			0.0,					! cut fill origin y
			0.0,					! cut fill direction angle
			245, 				! cut line pen
			1, 					! cut line type
			1,					! projected fill index 
			248, 				! projected fill pen
			121, 				! projected fill background pen
			0.0,					! projected fill originsx,
			0.0,					! projected fill origin y
			0.0,					! projected fill direction
			253, 				! projected line pen
			1 					! projected line type
4 REPLIES 4
Lingwisyer
Guru
By the sounds of it, would not using Project2{3} be more suitable? From my own experimentation, I do not believe that Project2{4} actually creates anything other than a contour at the defined levels.



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
runxel
Legend
Well, project2{4} isn't that bad. And you can indeed show coverfills and everything, all in one go, which is great.

BUT there is one big problem with project2{4}, namely it is bugged. You can't get a proper cut fill to show up.
This is known to GS, but as you might already guessed there is no ETA for a fix and still prevalent in 24.
If the fix ever sees the light of being in a production build this is surely the superior method. Until then... project2{3} might be a better choice, even if the markup is even more verbose to get the desired results.
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»
Peter Baksa
Graphisoft
Graphisoft
Hi,

maybe a clue to using project2{4} is understanding the number of cutplanes and where the different parts go.

Let's make this 3d:

rotz 45
rotx 45
roty 45
block 1,1,1
del 3
With 0 cutplanes the cutplane height mustn't be given, we are viewing the whole model from infinity:
project2{4} 3, 270,				! projection_code, angle,
	0, 1 + 2,				! useTransparency, statusParts,
	0,					! numCutplanes,
!	1,					! cutplaneHeight1,

	3 + 32, 4 + 8,				! method1, parts1,
	0,					! cutFillIndex1,
	0, 0,					! cutFillFgPen1, cutFillBgPen1,
	0, 0,					! cutFillOrigoX1, cutFillOrigoY1,
	0,					! cutFillDirection1,
	0, 0,					! cutLinePen1, cutLineType1,
	coverfill,				! projectedFillIndex1,
	viewpen, 0,				! projectedFillFgPen1, projectedFillBgPen1,
	0, 0,					! projectedFillOrigoX1, projectedFillOrigoY1,
	0,					! projectedFillDirection1,
	viewpen, solidline			! projectedLinePen1, projectedLineType1
The parameters commented cut... are irrelevant here.

Adding cutplanes, each slice displays the cut part and the viewed region of the model down to the previous cutplane. It is possible to draw an overhead part with setting the last slice method to wireframe:
project2{4} 3, 270,				! projection_code, angle,
	1, 1 + 2,				! useTransparency, statusParts,
	1,					! numCutplanes,
	1,					! cutplaneHeight1,

	! slice cutplane to bottom: shading with attribute override, cut and view
	3 + 32, 1 + 2 + 4 + 8,			! method1, parts1,
	cutfill,				! cutFillIndex1,
	cutpen, 0,				! cutFillFgPen1, cutFillBgPen1,
	0, 0, 0,				! cutFillOrigoX1, cutFillOrigoY1, cutFillDirection1,
	cutpen,	solidline,			! cutLinePen1, cutLineType1,
	coverfill,				! projectedFillIndex1,
	viewpen, 0,				! projectedFillFgPen1, projectedFillBgPen1,
	0, 0,					! projectedFillOrigoX1, projectedFillOrigoY1,
	0,					! projectedFillDirection1,
	viewpen, solidline,			! projectedLinePen1, projectedLineType1

	! slice top to cutplane: wireframe with attribute override, view
	1 + 32, 8,				! method(numCutplanes+1)), parts(numCutplanes+1),
	0,					! cutFillIndex(numCutplanes+1),
	0, 0,					! cutFillFgPen(numCutplanes+1), cutFillBgPen(numCutplanes+1),
	0, 0,					! cutFillOrigoX(numCutplanes+1), cutFillOrigoY(numCutplanes+1),
	0,					! cutFillDirection(numCutplanes+1),
	0, 0,					! cutLinePen(numCutplanes+1), cutLineType(numCutplanes+1),
	0,					! projectedFillIndex(numCutplanes+1),
	0, 0,					! projectedFillFgPen(numCutplanes+1), projectedFillBgPen(numCutplanes+1),
	0, 0,					! projectedFillOrigoX(numCutplanes+1), projectedFillOrigoY(numCutplanes+1),
	0,					! projectedFillDirection(numCutplanes+1),
	overheadpen, dashedline			! projectedLinePen(numCutplanes+1), projectedLineType(numCutplanes+1)
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Anonymous
Not applicable
Hi Peter -
Thanks for your response. This solves the mystery! I didn't realize that in the case of 1 cut-plane the final view was down to the slice. This function is now working nicely for me... .
Luke

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!