Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

GDL
About building parametric objects with GDL.

GDL Stretch fill

Richard Allili
Contributor

I'm creating a custom gdl object where the user can scale it's texture and fill also. I managed to scale the 

texture, but I'm having trouble scaling the fill. I'm looking to scale the fill which can be seen in the elevation view. 

For the texture I follow these steps:

1. Get the surface index from the building material

2. Get the texture information from the surface index

3. Create a new texture with scaled sizes (based on the informations from 2.)

4. Apply it to a new material

5. use this new material as a face of a wall (CWALL_ to be precise)


I tried out to set it in 2D script with GLOB_CONTEXT=4 (Elevation view) but nothing happened.

Anyone could help me out how this can be done? 


Code for the texture part (3D script) :

 
n = REQUEST{2} ("Building_Material_info", custom_material, "gs_bmat_surface", _surface_index)
n = REQUEST{2} ("Material_info", _surface_index, "gs_mat_texture",
            _file_name, _w, _h, _mask, _alpha)
define texture "CUSTOMTEXTURE" _file_name, _w * textureSegmentSizeX, _h * textureSegmentSizeY, _mask, 0
define material "CUSTOMmaterial" 21,
  1, 1, 1,
  1, 1, 0, 0.0,
  0, 0,
  IND(FILL, "CUSTOMFILL"), 1, ! Tried to make a custom fill from the building material's fill, but here is where I stuck.
  ind (texture, "CUSTOMTEXTURE")

CWALL_ "CUSTOMmaterial", 0, 0, ...

Note: In case of slab I've "cheated" my way and drawed a POLY2_B with the correct transformation matrix.
Is there a way to apply this to the elevation view's uncut fill?
5 REPLIES 5
GDL Enthusiast
Advocate

Hi Richard,

 

I also have trouble with GLOB_CONTEXT not doing anything in my script. I would be keen to see how that works in practice if anyone has experience in it.

 

Cheers, Matt

Jochen Suehlo
Moderator

GLOB_CONTEXT is depracted.
Have you tried GLOB_VIEW_TYPE instead?

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

Yeah, I did and still not working.

GDL Enthusiast
Advocate

Hi Richard,

 

I tried Jochens solution and this works for the 3D window. When viewed in Elevation there is nothing, but in 3D window the sphere is present. Note: 3D – 3, Section – 4.  I can't find what the other values 1, 2 and 5 would represent but prehaps they could be the floor plan or elevation?

!! 3D Script

IF GLOB_VIEW_TYPE = 3 THEN
ADD 0,0,0
SPHERE 0.105
Del 1
ENDIF

 

Sorry I can't help with the scaling, that is a bit beyond my knowledge. Best regards, Matt

There is no GLOB_VIEW_TYPE = 1.

 

BarryKelly_0-1740015609581.png

 

 

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