cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.

Is there a way to request a building material name?

Akira Ishida
Advocate
I want to display the building_material used for the element in text.

n = REQUEST ("Name_of_building_material", index, name)
text2 0,0, name

Archicad24 doesn't seem to work with the above script.
The building material name will be "undefined".
Please tell me the solution
9 REPLIES 9
Barry Kelly
Moderator
You have to supply the index number of an actual building material, otherwise it doesn't know which one you want.

i.e.
n = REQUEST ("Name_of_building_material", 100, name)
text2 0,0, name
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
Akira Ishida
Advocate
Thank you for your answer.
I found that I had to enter the index number when using this request command.

What command should I use to read the building material of an element and display it in text when the label is placed?
Podolsky
Ace
This one is a little bit tricky.
First, your element can have several Building Materials - if it's a composite wall, slab, or roof.
Second - you need to determine first in your label script - what is the element - is it fill, slab, roof, wall, beam, etc. For that, you need to use the global variable GLOB_ELEM_TYPE.
After your label script knows to which element is attached, it can scan receive building material name from another global variable:
WALL_BMAT_NAME or WALL_SKINS_BMAT_NAMES
COLU_CORE_BMAT or COLU_VENEER_BMAT
etc.
You can find the list of global variables at the end of the GDL Manual in the section Miscellaneous.

With GDL objects even more complicated - you need to request variable value from the script and receive building material name via
n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)
Akira Ishida
Advocate
Thank you for your answer.

I was able to confirm the operation of the label.
(If I actually use this, I need a little more ingenuity.)

By the way, can I load the building material into the object in the same way when the subtype is "model element"?
BMAT_information = ""

!5 -WALL
IF GLOB_ELEM_TYPE = 5 THEN
	IF WALL_SKINS_NUMBER = 0 THEN
		BMAT_information = WALL_BMAT_NAME

	ELSE
		BMAT_information = WALL_SKINS_BMAT_NAMES[1][1]
	ENDIF
ENDIF

!6 -COLUMN
IF GLOB_ELEM_TYPE = 6 THEN
	BMAT_information = COLU_VENEER_BMAT_NAME
ENDIF

!7 -SLUB
IF GLOB_ELEM_TYPE = 7 THEN
	IF SLAB_SKINS_NUMBER = 0 THEN
		BMAT_information = SLAB_BMAT_NAME
	ELSE
		BMAT_information = SLAB_SKINS_BMAT_NAMES[1][1]
	ENDIF
ENDIF

!8 -ROOF
IF GLOB_ELEM_TYPE = 8 THEN
	BMAT_information = ROOF_BMAT_NAME
ENDIF

!12 -BEAM
IF GLOB_ELEM_TYPE = 12 THEN
	BMAT_information = BEAM_BMAT_NAME
ENDIF

TEXT2 0,0,BMAT_information
Podolsky
Ace
Script looks OK.

I didn't get your last question.
To receive Building Material name from the object you need to use this script:

!1 -OBJECT
IF GLOB_ELEM_TYPE = 1 THEN
	n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)
        IF n AND type = 16 THEN BMAT_Information = p_values
ENDIF

where expr - the name of the parameter in the object, related to Building Material.

Don't forget to define fill for the label. It's useful when you do 2D details. The attached example is showing a custom-made label, that defines Building Material names on details.
furtonb
Advisor
Somewhat related: is there a way to request user-made property values of a building material?
E.g. I define the vapour resistance of a material, which is not part of the "normal" building physics properties...
odv.hu | actively using: AC25-27 INT | Rhino6-8 | macOS @ apple silicon / win10 x64
Peter Baksa
Graphisoft
Graphisoft
furtonb wrote:
Somewhat related: is there a way to request user-made property values of a building material?
E.g. I define the vapour resistance of a material, which is not part of the "normal" building physics properties...
REQUEST "Component_Properties_Of_Parent"?

The Archicad Library uses this in Component Classification and Properties Label.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
gdford
Advisor
There is not an off-the-shelf way to do this with autotext.
I suppose with GDL it could be done, but the solution for this should come out of the box.
Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000
furtonb
Advisor
I agree. The most comprehensive access to properties/GDL parameters is within the interactive schedule criteria and field list. It would be useful to have the same access depth in autotext labels.

Another issue is extracting sub-element information: with hierarchial elements (curtain walls, railings) you can press tab to get a level deeper and annotate CW panels, etc., but with composites I cannot do that AFAIK.

E.g. you have a composite wall and you want to annotate the manufacturer and description of the core - which is something you define at the bMat level.
odv.hu | actively using: AC25-27 INT | Rhino6-8 | macOS @ apple silicon / win10 x64