Choose your top Archicad wishes!

Read more
GDL
About building parametric objects with GDL.
SOLVED!

Issue or limitation of PROJECT2{4} ?

MetalFingerz
Advocate

Hello,

 

I'm playing around with PROJECT2{4} as I'm trying to do a quick 2D projection of an object but I can't find a solution to my issue. Basically, my object has some voids in them and when cutting, I'd like to be able to see the void that is supposed to appear at the cutplane height.

 

So below is an example object : some pyramid with a hole. I want to create a 2D view for which the cutting plane changes according to GLOB_CUTPLANES_INFO[1].

 

pyramid_3D.png

 

I'm using PROJECT2{4} with the following parameters :

 

code			= 3
angle			= -90
useTransparency		= 0
statusParts		= 0
numCutplanes		= 1
cutHeight		= 0.5	! supposed to be GLOB_CUTPLANES_INFO here
method1 		= 3+32
parts1			= 1+2+4+8
method2			= 3+32
parts2			= 2+4

PROJECT2{4}	code, angle,
		useTransparency, statusParts, numCutplanes, cutHeight,
		method1, parts1,
		_fill_type_uncut, _fill_pen_uncut, _fill_bg_pen_uncut,
		0, 0, 0,
		_pen, _line_type,
		_fill_type_uncut, _fill_pen_uncut, _fill_bg_pen_uncut,
		0, 0, 0, 
		_pen_uncut, _line_type_uncut,
		method2, parts2,
		_fill_type, _fill_pen, _fill_bg_pen,
		0, 0, 0,
		_pen, _line_type
		_fill_type, _fill_pen, _fill_bg_pen,
		0, 0, 0, 
		_pen, _line_type

 

 

And this is the result :

pyramid_2D_cut.png

 

Blue is below cutting plane and red is the cut part. You can see that the cutting plane cuts where it is supposed to but is unable to display it properly as the center part shouldn't exist. Is it a limitation of PROJECT2{4} or did I make a mistake with my parameters ?

 

Here is the code for the pyramid just in case :

 

group "plus"
	pyramid	5, ZZYZX, 1+4+16,
		-0.5, -0.5, 15,
		0.5, -0.5, 15,
		0.5, 0.5, 15,
		-0.5, 0.5, 15,
		-0.5, -0.5, -1
endgroup

group "minus"
	prism_	5, 1,
		-0.1, -0.5, 15,
		0.1, -0.5, 15,
		0.1, 0.5, 15,
		-0.1, 0.5, 15,
		-0.1, -0.5, -1
endgroup

g001 = subgroup("plus", "minus")
placegroup g001

 

 

And for info, I'm using Archicad 24 7006.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
Jochen Suehlo
Advisor

I used an object, with mainly scripts from Graphisoft and got it work correctly.pyramid.png

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de

View solution in original post

Solution
runxel
Legend

Project2{4} is hard to understand and harder to master.

It is not obvious, but it is not a bug.

Let me explain; it has to do with the fact, that you always need one time more set parameters than you have as cutplanes.

Setting "0" (zero) as numCutplanes is possible, you then have to omit cutHeight. This would simulate the earlier types of the Project2 command.

But ofc we don't want that, we want our shiny built-in cutplane!

So, what we actually see here with your pyramid example is a projection. And now it comes together with what I just said. We need to always make one more parameter set, because the last one is the projection!

Which means, to resolve your issue, you will need to set the method of the second parameter set to "0" (method2 = 0). This tells Archicad to actually not include this projection in the final output.

Et voilá, happy coding!

runxel_0-1691094338949.png

 

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 |

«Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

6 REPLIES 6
DGSketcher
Legend

Project2{4} is a complex beast. I found with a lot of trial and error I got to where I wanted in the end.

 

You may want to look at the parts aspect, which iirc determines the presence of the cut & projected lines & fills. If you don't want the fill it can be omitted. If you have "projected parts" in play then you may be seeing the bottom face of the pyramid, in which case you may want to set up a cut plane just above the base of the pyramid.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

I tried all 15 combinations on both planes but none allowed me to have the result I wanted 😭 Most importantly, I never got the void on the upper plane displayed correctly, it was always solid no matter which code I put.

 

I thought it could also be the methods and tried the 256 or 512 modifiers or the 2 and 4 value but to no avail as well (I don't even think 256 or 512 did anything to be frank). I'm hitting a brick wall with this so I figured I asked here because I usually get the solution and it's often super obvious.

Solution
Jochen Suehlo
Advisor

I used an object, with mainly scripts from Graphisoft and got it work correctly.pyramid.png

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Solution
runxel
Legend

Project2{4} is hard to understand and harder to master.

It is not obvious, but it is not a bug.

Let me explain; it has to do with the fact, that you always need one time more set parameters than you have as cutplanes.

Setting "0" (zero) as numCutplanes is possible, you then have to omit cutHeight. This would simulate the earlier types of the Project2 command.

But ofc we don't want that, we want our shiny built-in cutplane!

So, what we actually see here with your pyramid example is a projection. And now it comes together with what I just said. We need to always make one more parameter set, because the last one is the projection!

Which means, to resolve your issue, you will need to set the method of the second parameter set to "0" (method2 = 0). This tells Archicad to actually not include this projection in the final output.

Et voilá, happy coding!

runxel_0-1691094338949.png

 

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 |

«Furthermore, I consider that Carth... yearly releases must be destroyed»

Thanks for the object, it worked and is well documented 👍

At first I thought it wasn't working because my project cutplane was at 1100 which was the same height as the void. Changing it made it work.

Thanks for breaking it down, makes more sense that way.

 

I had figured that the numCutplanes+1 thing going on because first I put numCutplanes at 0 and I had a too many parameters error (needed 23 instead of 24 which was weird). Then I reread the documentation and stumbled upon "The number of cutplanes can be zero, creating exactly one uncut slice (numCutplanes+1)." and that's when I figured that cutHeight was to be omitted when it's the case. The "uncut slice" plays a huuuuge part in understanding this command and is barely a footnote. I feel like the documentation should be a more explicit there.

 

But I never would have thought that the projection plane was bubbling up so in my opinion, this plane was always tied to method1 and I would have never tried to put method2 at 0. I guess I didn't get that logic.

 

Anyway, as always, the solution was simple and as always, I need to try to think more outside of the box. Well, mine at least 😅

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!