Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.
3 weeks ago
- last edited
3 weeks ago
by
Laszlo Nagy
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, ...
3 weeks ago
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
3 weeks ago
GLOB_CONTEXT is depracted.
Have you tried GLOB_VIEW_TYPE instead?
3 weeks ago
Yeah, I did and still not working.
3 weeks ago
- last edited
3 weeks ago
by
Laszlo Nagy
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
3 weeks ago
There is no GLOB_VIEW_TYPE = 1.
Barry.