GDL
About building parametric objects with GDL.

Project2

DGSketcher
Legend
Just wondering if anyone has a working solution for the display of Building Material hatches in the 2D plan?

I have a component using multiple materials which in section & elevation display as expected. When I move to view in 2D with an appropriately placed view cut plane the cut is ignored and the full object is displayed. Adding a Cutplane to the 3D script means the various elements show as hollow and are coloured with their surface material. Am I missing a trick with the various Project2 options? I am reluctant to write the 2D script for such a complex object.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
10 REPLIES 10
Lingwisyer
Guru
Don't use a cutplane.

I do not believe you can display multiple building materials, much like you not being able to have multiple line settings, as stated on the Project2{3} help page. See my exploration of 2{4} in this thread.

One thing I have not explored yet is whether you can use the multiple cutplanes in order to faux this representation by staggering your vertical extrusions since each cutplane has it's own line and fill settings. So your top cutplane only cuts a single material group, the following cutplane cuts the group below as well as the first, etc. This would require you to create voids in your object so that each "layer" down contains only one new material. A fair bit of work to achieve... at which point I figure you may as well just create a full 2D script for each part.



Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
DGSketcher
Legend
Thanks Ling, interesting idea with 2{4} but as you say the juggling of levels may be more effort than it's worth. It would be feasible but I think you would need to setup staggered cut planes for each material before applying 2{4}. In my case case I have about 8 materials to manage.

I am considering if I need to break the object down into separate GDL parts for each material, each containing their own Project2 and Call them from a parent routine to make a single object... I am assuming that there isn't a way to force a 3D rebuild and be able to apply a new Project2 within the same object. For example, in the 2D script after the first projection you could change variables, force a 3D rebuild and then run Project2 again and repeat as necessary.

On the other hand we could just wait for Project2{5} where the cut fill settings are optional and default to displaying each of the Building Material section fills at the cut plane so we can finally match Section View fills. Is there a GDL Wishlist?

Trevor
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Lingwisyer
Guru
I do not recall there being a wish.

A Project2 that will cut and display fills and materials based on the building materials involved. That would be nice.

You mentioned calling each part with it's own Project2. Have you tried it before?



Ling

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
DGSketcher
Legend
I'm just getting my head round it now. At first look it may not be as complicated as I feared. I am thinking out loud here... If I take my current object and duplicate it as the host this gives me all the parameters in the called object. Adding a new Parameter variable for the material number which could be set with a For-Next loop this then Calls the original object with the material number and passes ALL the other parameters to it. Within the original object I then need to have the various 3D elements only visible if their material number matches the host call value. Once the For-Next is complete I assume I will have the full model displayed. Any thoughts before I waste another day of my life on a dead end?
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
runxel
Legend
Guys, project2{4} is bugged.

There is a rather convoluted workaround – have a look inside the "CWFrameRegDouble" macro for that.
Basically you loop over all different parts of your object, seperated into bmats, where you overwrite the attributes ( "Building_Material_info" request).
Then you'll need another project2{4} for all uncut elements...

Yeah...

Hopefully this mess get's fixed in the first update of 24.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
DGSketcher
Legend
Thanks! Good to know about the bugs. Seems like I am on the right track though.

It would helpful after abandoning GDL Centre if GS would pop in here and share their GDL expertise.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
Anonymous
Not applicable
Hi Trevor,
DGSketcher wrote:
Adding a Cutplane to the 3D script means the various elements show as hollow and are coloured with their surface material.
Can you show us some screenshot of this... and perhaps some elaboration on what is the purpose of the object?
Maybe we can manage a workaround.
Cheers,
Lingwisyer
Guru
Hearing that Project2{4} is bugged is interesting. I had thought that that setting that you pointed out just meant that the object would use the Floor Plan and Section settings. Good to know it was meant for greater things.



Ling

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
DGSketcher
Legend
@Paulo, Thanks for the offer, it is appreciated. Since my last post I now have it working. The 2D script code looks like this...
	!!! Obtain Building Material Data

		DIM BMFill[10], BMFPen[10], BMBPen[10], BMSurf[10]

		! DIM BMat[10] Declared in Master Script and filled with values from Parameters

		FOR k = 1 TO 10
			n = REQUEST{2} ("Building_Material_info", BMat, "gs_bmat_cutFill_properties", BMFill, BMFPen, BMBPen)
			n = REQUEST{2} ("Building_Material_info", BMat, "gs_bmat_surface", BMSurf)
		NEXT k

		! set general 2D attributes
		PEN 1							!Pen General for outline
		LINE_TYPE 1
		iProjectionCode = 3		!Top view
		angleProjection = 270
		iProjectionMethod = 3	!Shaded
	
		!Uncut elements - Draw model without cuts fills
		PROJECT2{3} iProjectionCode, angleProjection, iProjectionMethod + 16, 4+8, 19, 0,0,90, PARAMETERS BMN = 2+4+8+16+32+64 !+128
		
		FOR j = 1 to 10
		MATERIAL BMSurf
		FILL BMFill					!Fill General
		fillFGPenGeneral = BMFPen	
		fillBGPenGeneral = BMBPen	!Fill BGPen General
	
		!Cut elements - Draw cut section fills only 
		PROJECT2{3} iProjectionCode, angleProjection, iProjectionMethod + 32, 1+2, fillBGPenGeneral, 0,0,90, PARAMETERS BMN = BITSET(0,j)
	
		NEXT j
In the 3D script you need to apply a cutplane and your model needs to be able to be displayed in full with the cuts, but it also needs to display elements grouped by material. I control these with the binary settings of the BMN values. So in the code above, the first Project2 sets the BMN "flags" to display all uncut parts of the model, the second steps through the flags displaying the different cut fills generated for each model part in each loop. I know it appears a bit complex and the binary display solution could probably be overcome by other comparison methods, but this way I can also use it to easily filter one or several elements to display e.g. just the structure or just the finishes etc. I may be wrong but I believe this works because of the PARAMETERS statement at the end of the Project2 which forces a redraw. BMN is initialised in the Parameters values along with the materials etc.

I'm not a professional coder, but I hope this helps lift some more of the mystery surrounding Project2. Thanks for the pointers in the previous posts which cast the necessary light on a solution.
Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

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!